更新的mysqli版本:
if ($result = $mysqli->query("SHOW TABLES LIKE '".$table."'")) { if($result->num_rows == 1) { echo "Table exists"; }}else { echo "Table does not exist";}
原始mysql版本:
if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '".$table."'"))==1) echo "Table exists";else echo "Table does not exist";
从PHP docs引用。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)