Page 1 of 1

mysql count tables in a database

Posted: Thu Aug 16, 2007 1:35 am
by gpong
hi

i was wondering if there was a mysql function that counted the number of tables in a database.

if anyone knows of such a command that would be great.

thanks

Posted: Thu Aug 16, 2007 3:15 am
by onion2k
There's no single function that can do it, but it can be done.

Code: Select all

//Stuff to connect to database
$rsTables = mysql_query("show tables", $databaseConnection);
$intNumberOfTables = mysql_num_rows($rsTables);