dbDelta not CREATING TABLE

Question

Here’s my code.
Please help

function lapizzeria_database() {
   global $wpdb;

   global $lapizzeria_db_version;
   $lapizzeria_db_version = "1.0";

   $table = $wpdb->prefix . 'reservation';

   $charset_collate = $wpdb->get_charset_collate();

   //SQL Statement

   $sql = "CREATE TABLE $table (
        id mediumint(9) NOT NULL AUTO_INCREMENT,
        name varchar(50) NOT NULL,
        date datetime NOT NULL,
        email varchar(50) DEFAULT '' NOT NULL,
        phone varchar(10) NOT NULL
        message longtext NOT NULL,
        PRIMARY KEY (id)
   ) $charset_collate; ";

   require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
   dbDelta($sql);
}

add_action('after_setup_theme', 'lapizzeria_database');
0
, , Arvin Bahilango 2 years 2019-12-28T02:53:40-05:00 0 Answers 99 views 0

Leave an answer

Browse
Browse