



(11 votes)// listdb.php by detour@metalshell.com // // List all databases availible in mysql. // // http://www.metalshell.com/ // $dbuser = "user"; $dbpass = "pass"; $dbhost = "localhost"; echo('<html><head><title>Database List</title></head><body>'); echo('<font face="arial" style="font-weight:bold">'); // Connect to mysql $dbid = mysql_connect($dbhost, $dbuser, $dbpass); // Get the list. $db_list = mysql_list_dbs($dbid); echo('<H1>Availible Databases</H1>'); // Process each row as an object. while($row = mysql_fetch_object($db_list)) { // Print out the database name. echo $row->Database . "<br>"; } // Close connection. mysql_close($dbid); echo('</body></html>');