To check if the table exists or not use the following syntax −
CREATE TABLE IF NOT EXISTS yourTableName ( yourColumnName1 dataType, . . . . N );
Here we will try to create an already existing table then it will generate a warning message "Table already exists". Let's first create a table. This table already exists. ##
The above is the detailed content of Check if a table in MySQL exists and show a warning if it exists?. For more information, please follow other related articles on the PHP Chinese website!