Larry Martell
2014-02-25 21:28:18 UTC
Is there any way to find out what database I am connected to from a
link identifier?
I have some code this does this:
@ $db = mysql_pconnect($dbserver, $dbuser, $dbpass);
@ mysql_select_db($dbname, $db);
I know at the time this is executed $dbname is what I want it to be.
But later on when I pull data using $db, I get data from a different
database. If I try to echo $db at the time of the query I get
"Resource id #5". Can I get the database name from $db?
link identifier?
I have some code this does this:
@ $db = mysql_pconnect($dbserver, $dbuser, $dbpass);
@ mysql_select_db($dbname, $db);
I know at the time this is executed $dbname is what I want it to be.
But later on when I pull data using $db, I get data from a different
database. If I try to echo $db at the time of the query I get
"Resource id #5". Can I get the database name from $db?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php