Jump to content

Archived

This topic is now archived and is closed to further replies.

acey99

What db am I using?

Recommended Posts

ok I was told to use

 

$q=mysql_query("SELECT DATABASE()");

 

 

to return what db i'm on, the problem is I don't know how to use this in php,

 

any help?

 

 

Share this post


Link to post
Share on other sites

$q=mysql_query("SELECT DATABASE()");
$col = mysql_fetch_array($q);
echo "Database: ".$col[0];

 

HTH

Share this post


Link to post
Share on other sites

See the MySQL Data Retrieval section of the PHPFreaks FAQ linked in my signature.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.