jester626 Posted December 17, 2006 Share Posted December 17, 2006 Anyone have a small snippet of code on how to use SHOW TABLES inside of PHP?Thanks in advance Link to comment https://forums.phpfreaks.com/topic/30979-simple-show-tables-snippet/ Share on other sites More sharing options...
AndyB Posted December 17, 2006 Share Posted December 17, 2006 [code]mysql_select_db("foobar");$query = "show tables";$result = mysql_query($query);$num_results = mysql_num_rows($result);print "There are $num_results tables.<br>";for ($i = 0; $i < $num_results; $i++){$row = mysql_fetch_array($result);print "table " . $row[0] . " exists.<br>";}[/code]http://dev.mysql.com/doc/refman/5.0/en/show.html Link to comment https://forums.phpfreaks.com/topic/30979-simple-show-tables-snippet/#findComment-142990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.