string mysql_db_name(resource $result, in $rowno [, mixed $field])
(PHP 4, PHP 5)
| $result | The query result from a call to the function: mysql_list_dbs. |
|---|---|
| $rowno | Offset to the row number to navigate to. This number must be between 0 and rowcount - 1. |
| $field | The name of the field to retrieve. |
| RETURNS | The name of the database on success, or false when an error occurs. |
Retrieves the name of a database from the results set ($result) of a call to mysql_list_dbs. The result is a list of all databases that are available to the user on the MySQL database server.
// open the mysql resource $res = mysql_connect($server, $user, $pass); // retrieve the list of databases from the server $databases = mysql_list_dbs(); // get the first database name echo 'Database(0) = ' . mysql_db_name($databases, 0);