Welcome Guest, Not a member yet? Register   Sign In
Get current database name
#1

[eluser]Gaz[/eluser]
Hi all,

Is there a function (or code snippet) to return the currently active database name?

I know I can use mysql_db_name, but where do I get the connection ID from?

Cheers,
Gaz.
#2

[eluser]danmontgomery[/eluser]
You don't pass mysql_db_name a connection ID.

http://php.net/manual/en/function.mysql-db-name.php
http://www.php.net/manual/en/function.my...st-dbs.php

However,

Code:
echo $this->db->database;
#3

[eluser]Gaz[/eluser]
OK, thanks on both counts :-)

Cheers,
Gaz.




Theme © iAndrew 2016 - Forum software by © MyBB