drifter Posted December 20, 2006 Share Posted December 20, 2006 is there a way to find out if a mysql table exists in my db? Quote Link to comment Share on other sites More sharing options...
fert Posted December 20, 2006 Share Posted December 20, 2006 [code]$result=@mysql_query("SELECT `col` FROM `table`",$cn) or die(mysql_error())if(mysql_num_rows($result)!=0){echo "Table exists";}else{echo "Table doesn't exist";}[/code]or you could list the tables and search for the table name. Quote Link to comment Share on other sites More sharing options...
trq Posted December 20, 2006 Share Posted December 20, 2006 use [url=http://php.net/mysql_list_tables]mysql_list_tables[/url](). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.