CodeIgniter Forums

Full Version: how to get the current dbprefix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]chiste[/eluser]
I'm in a situation in which I need to store the current dbprefix, change it to something else, do something, and then change it back to the original one.

I'll like to do something like this:

Code:
$currentprefix = getCurrentDBPrefix();
$this->db->set_dbprefix('something_else_');
// do something
$this->db->set_dbprefix($currentprefix);

I the current dbprefix available in some form of variable?
Is there a method to do this?

Please help. Thanks