Answers for "php mysqli check if table exists"

PHP
2

check if table exists sql php

if ($result = $mysqli->query("SHOW TABLES LIKE '".$table."'")) {
    if($result->num_rows == 1) {
        echo "Table exists";
    }
}
else {
    echo "Table does not exist";
}
Posted by: Guest on December-08-2020
-1

mysql create table if not exists

CREATE TABLE [IF NOT EXISTS] table_name(
   column_1_definition,
   column_2_definition,
   ...,
   table_constraints
) ENGINE=storage_engine;
Posted by: Guest on October-14-2020

Browse Popular Code Answers by Language