This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0.Instead, theMySQLi orPDO_MySQL extension should be used.See alsoMySQL: choosing an API guide.Alternatives to this function include:
SELECT DATABASE()Retrieve the database name from a call tomysql_list_dbs().
resultThe result pointer from a call tomysql_list_dbs().
rowThe index into the result set.
fieldThe field name.
Returns the database name on success, andfalse on failure. Iffalse is returned, usemysql_error() to determine the nature of the error.
Example #1mysql_db_name() example
<?php
error_reporting(E_ALL);
$link=mysql_connect('dbhost','username','password');
$db_list=mysql_list_dbs($link);
$i=0;
$cnt=mysql_num_rows($db_list);
while ($i<$cnt) {
echomysql_db_name($db_list,$i) ."\n";
$i++;
}
?>Note:
For backward compatibility, the followingdeprecated alias may be used:mysql_dbname()
