Jump to content

[SOLVED] Number of tables in a DB


ballouta

Recommended Posts

Hi

the SHOW TABLES FROM db_name is working

 

how do i loop and print the tables names?

 

thank you

 

You actually don't need the "FROM" clause, since you would have already selected a DB to use. Try this:

<?php
$sql = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_row($sql))
{
  echo $row[0] . "<br />\n";
}
?>

 

Hope that helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.