How can I get a list of all the MySQL databases that exist on a server using PHP?
$result = mysqli_query($db_conn,"SHOW DATABASES"); 
while ($row = mysqli_fetch_array($result)) { 
    echo $row[0]."<br>"; 
}
                        $dbcnx = mysql_connect ($dbhost, $dbusername, $dbpassword); 
$result = @mysql_query('SHOW DATABASES'); 
while ($row = mysql_fetch_array($result)) { 
 print_r ($row)
} 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With