Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ThemeMetric/5b027106f55f87f143281db7fc215e11 to your computer and use it in GitHub Desktop.
Save ThemeMetric/5b027106f55f87f143281db7fc215e11 to your computer and use it in GitHub Desktop.
<?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