Create table in database in wordpress <?php /*=====================Create table in wordpress database====================*/ /* ++++++ Created user_tbl table +++++++*/ function create_users(){ global $wpdb; $create_cases_table_name = $wpdb->prefix . "users"; $create_cases_table_query = "CREATE TABLE $create_cases_table_name ( ID mediumint(9) NOT NULL AUTO_INCREMENT, status ENUM('0', '1') DEFAULT '1' COMMENT '1 = active 0 = not active', type ENUM('google', 'facebook', 'apple') NOT NULL COMMENT 'google, facebook, apple', first_name Varchar(255) NULL, last_name Varchar(255) NULL, email Varchar(255) NULL, device_type LONGTEXT NOT NULL, created TIMESTAMP DEFAULT '0000-00-00 00:00:00', updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY ID (ID) ) $charset_collate;"; ...
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.