After connecting to a MySQL server, can PHP return information about the MySQL server?
I’m looking for a way for PHP to echo back the names of each database contained on the MySQL server along with all the names of each table contained in each database.
Assuming that this is the code used to connect to the MySQL server:
[code]
<?
$link = mysql_connect(“xxxxx.xxxxxx.xxxxx:xxxxxxxxx”,”xxxxxxxxxx”,”xxxxxxxxxx”);
if(!$link){die(‘Connection:n<br>nFAILURE!’ . mysql_error());}
echo ‘Connection:n<br>nSUCCESSFUL!n’;
mysql_close($link);
?>
How can I echo back a report similar to:
[code]
Connection:
SUCCESSFUL!
businesses
+table1
+table2
orginations
+table1
airports
+table1
+table2
+table3
+table4
Extra credit if you come-up with a way for PHP to also echo the table format of each table.
Thanks in advance!