Created
February 5, 2018 12:21
-
-
Save ThemeMetric/5b027106f55f87f143281db7fc215e11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly. | |
} | |
global $wpdb; | |
$prefixd=$wpdb->prefix; | |
$table=$prefixd.'tbl_area'; | |
$charset_collate = $wpdb->get_charset_collate(); | |
$sql = "CREATE TABLE $table ( | |
id mediumint(9) NOT NULL AUTO_INCREMENT, | |
name tinytext NOT NULL, | |
code text NOT NULL, | |
user_id int, | |
status int, | |
note text NOT NULL, | |
created_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, | |
update_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, | |
PRIMARY KEY (id) | |
) $charset_collate;"; | |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); | |
dbDelta( $sql ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment