Jump to content


Photo

What db am I using?


  • Please log in to reply
2 replies to this topic

#1 acey99

acey99
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 07 December 2005 - 07:14 PM

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?



#2 seanlim

seanlim
  • Members
  • PipPipPip
  • Advanced Member
  • 355 posts
  • LocationLondon, United Kingdom

Posted 08 December 2005 - 05:29 PM

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

HTH

#3 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts
  • LocationMassachusetts

Posted 11 December 2005 - 02:58 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users