PDA

View Full Version : Php/Mysql Help-Getting Databases


Kura_kai
05-18-2005, 12:34 AM
Is there a command that returns in a array all of the databases? If not something similiar to getting databases.

Tangerine Dream
05-18-2005, 01:30 AM
Hi, if you want a list of databases, you need SHOW DATABASES (http://dev.mysql.com/doc/mysql/en/show-databases.html) statement that returns DB names in 'Database' column

Kura_kai
05-18-2005, 02:30 AM
Sorry forgot to tell you though title showed it. But i want it to be a php command. sorry

Tangerine Dream
05-18-2005, 11:00 AM
Check PHP manual' mysql_query (http://www.php.net/manual/en/function.mysql-query.php) topic or any other MySQL related tutorials for examples, i.e just replace SQL statement like "SELECT * FROM ... WHERE ...." with "SHOW DATABASES" and use appropriate mysql_fetch_xxxx (http://www.php.net/manual/en/ref.mysql.php) function to get values of 'Database' column. Now, this thread is about PHP :)

Kura_kai
05-18-2005, 02:53 PM
ok if possible can someone give me a sample script not sure what you are talking about.