prefix . 'adv_customers'; $charset_collate = $wpdb->get_charset_collate(); $sql=" CREATE TABLE $table_name ( ID mediumint(9) NOT NULL AUTO_INCREMENT, createddate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, name tinytext NOT NULL, surname tinytext NOT NULL, company tinytext, vat varchar(25), address tinytext NOT NULL, city tinytext NOT NULL, state tinytext NOT NULL, telephone tinytext, mail tinytext NOT NULL, PRIMARY KEY (ID) ) $charset_collate;"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); add_option('db_adv_customers',$db_adv_management); } function delete_adv_db_customers(){ global $wpdb; $table_name = $wpdb->prefix . 'adv_customers'; $wpdb->query( "DROP TABLE IF EXISTS $table_name"); delete_option('db_adv_customers'); } ?>