Welcome Guest, Not a member yet? Register   Sign In
database name available within models
#1

[eluser]alive[/eluser]
Is there a way to have access to the current database name (set up in database.php) in a model? I can always load the database config file, but it seems like so obvious a need that there's probably already an easier way I'm not aware of. Something like a
Code:
$this->db->name
variable or a function tucked neatly away in the database class.

Any help to offer?
#2

[eluser]danmontgomery[/eluser]
Code:
$this->db->database
#3

[eluser]alive[/eluser]
Works like a charm. Thanks. Is that in the User Guide? If not, where does one find little treats like that?
#4

[eluser]danmontgomery[/eluser]
Not in the documentation anywhere I've seen... I just searched system/database for mysql_select_db.




Theme © iAndrew 2016 - Forum software by © MyBB