Welcome Guest, Not a member yet? Register   Sign In
database info - retrievable?

Hey, my apologies if this has already been asked, but my quick glance through forum searching didn't find anything.

Is there a way in a controller (or model) to retrieve the database information stored in the database.php config file?

I need the info stored in
$db['default']['database'] = "db_name";

Please help,


you can include the database file, and then access the $db array variable

include APPPATH.'config/databae.php';
echo $db['default']['database'];

Theme © iAndrew 2016 - Forum software by © MyBB