The following code lists all tables in a MySQL database:
mysql_connect("localhost","user","pass") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
$rs = mysql_query("show tables") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print '<br>' . $row[0];
}