List databases – PHP

<?php

mysql_list_dbs();

Example :

$connection=mysql_connect(“localhost”,”root”,”password”);

$dataBases = mysql_list_dbs($connection);

while ($db = mysql_fetch_object($dataBases)) {

echo $db->Database . “<br />”;

}

?>

Share

Beginners' Guide , PHP Programmer , Zend Certified Engineer , Magento Certified Developer