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? Link to comment https://forums.phpfreaks.com/topic/31312-table-exists/ 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. Link to comment https://forums.phpfreaks.com/topic/31312-table-exists/#findComment-144898 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](). Link to comment https://forums.phpfreaks.com/topic/31312-table-exists/#findComment-144945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.