Page 1 of 1

mysqli list database names

Posted: Thu Nov 26, 2009 2:14 pm
by amichael
I've never had to find a list of MySQL database names before using PHP. I see that there is a mysql_list_dbs() function, but I see no equivalent using mysqli. Haven't found any info using google.

How can I grab a list of database names using mysqli? Is there a function or some sort of query I can run?

Thanks in advance!

Re: mysqli list database names

Posted: Thu Nov 26, 2009 4:36 pm
by pickle
SHOW DATABASES() is a query you can run. 5 minutes of searching the docs & Googling didn't show me any other way to do it.

Re: mysqli list database names

Posted: Sun Dec 06, 2009 9:30 pm
by amichael
Works perfectly. Thanks pickle.