mysql_db_name()

It returns database name from the call to mysql_list_dbs()

Example

<?php
$conn = mysql_connect(“localhost”, “root”, “password”) or die(mysql_error());
$db_list = mysql_list_dbs($conn);
$db_count = mysql_num_rows($db_list);
for($i=0;$i<$db_count;$i++){
echo mysql_db_name($db_list, $i) . “<br />”;
}
?>

Share