[SOLVED] listing Tables in data base
Posted: Fri Oct 22, 2004 2:45 am
i can get this to work and it prints out the tables just fine but i want to be able to use them in a display block and can't figure out how to do it.
Code: Select all
<?php
mysql_connect("localhost", "user", "password");
$result = mysql_list_tables("db_name");
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
echo "Table: ", mysql_tablename($result, $i), "\n";
}
mysql_free_result($result);
?>