mysql_list_dbs

mysql result mysql_list_dbs([mysql link connection]) 

Lists the databases on a MySQL server.

Returns:

MySQL result handle; FALSE on error

Description:

mysql_list_dbs() fetches a list of the databases available for a given connection and returns a MySQL result handle that can be traversed with mysql_result(). If the connection argument is not specified, the last connection opened will be used. If no connection is open, mysql_list_dbs() attempts to connect to a MySQL database by calling mysql_connect() without arguments.

Version:

PHP 3+, PHP 4+

See also:

To gather information on the fields in a table:

mysql_list_fields() 

To gather information on the tables in a database:

mysql_list_tables() 

Example:

Display a list of all databases ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.