Entry
How do you show all tables in a DB in PHP script?
Mar 6th, 2002 01:37
Nick R, SE Cash,
hello,
<!--where you see replace_ change to your info.-->
<html>
<body>
<?php
//Comment: connect to db replace username, pass, and db
$link_id = mysql_connect
("localhost", "replace_your_user_name", "replace_your_password");
$result=mysql_select_db("replace_your_database", $link_id);
/*Comment: use mysql_list_tables and replace first quotes"" with your
database name*/
$result1=mysql_list_tables("replace_your_database", $link_id);
//Comment: use while loop to display results
while($data=mysql_fetch_row($result1))
{
echo "<br>".$data[0];
}
?>
</body></html>