|
| |
PHP MySQL Functions to list table names in a databases |
We can display a list of tables present in a table by using mysql_list_tables() function. Connection has to be established before call of this function. The result pointer returned by this function is used by mysql_tablename() function to display the name of the tables.
<?
$list = mysql_list_tables ("sql_tutorial");
$i = 0;
while ($i < mysql_num_rows ($list)) {
$tb_names[$i] = mysql_tablename ($list, $i);
echo $tb_names[$i] . "<BR>";
$i++;
}
?>
| |
|
|
|