MySQL: SHOW TABLES only returns the first table

DavidR

New Member
I am using SHOW TABLES to retrieve a list of tables in the DB.The DB has 19 tables\[code\]$db = mysql_connect($dbhost, $dbuser, $dbpassword);if (!$db) { die('Could not connect: ' . mysql_error()); }$dbselect = mysql_select_db($dbase,$db);if(!$dbselect) { die('Could not connect: ' . mysql_error());}$c_query=mysql_query("SHOW TABLES ",$db);var_dump(mysql_fetch_array($c_query));\[/code\]The OUTPUT only gives an array with the first table\[code\]array(2) { [0]=> string(5) "tabl1" ["Tables_in_dbase"]=> string(5) "tabl1" } \[/code\]Why? How do I retrieve a list of all tables in the db?Update: Looping seems to be the answer. There does not appear to be a query which returns all the entries in one query.
 
Back
Top