Checking if Database Table exists
Question
I read the wordpress codex and professional wordpress. It seems both use something like
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
to determine if the table exists. Is there any reason why CREATE TABLE IF NOT EXISTS ( ... )
is not used? It will check and create the table in 1 query, won’t it be better? Or am I missing something?
0
2 years
2020-12-15T22:10:23-05:00
2020-12-15T22:10:23-05:00 0 Answers
6 views
0
Leave an answer