📜  检查表是否存在 sql php 代码示例

📅  最后修改于: 2022-03-11 14:54:41.427000             🧑  作者: Mango

代码示例1
if ($result = $mysqli->query("SHOW TABLES LIKE '".$table."'")) {
    if($result->num_rows == 1) {
        echo "Table exists";
    }
}
else {
    echo "Table does not exist";
}