Last active
February 23, 2016 05:29
-
-
Save developer-anuragsingh/0d2d58badacc35e5aec0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** Error reporting */ | |
global $wpdb; | |
$wpdb->show_errors(); | |
// For WordPress Multisite, you must define the DIEONDBERROR constant for database errors to display | |
define( 'DIEONDBERROR', true ); | |
/** Error reporting */ | |
$table = $wpdb->prefix . "report_performance"; | |
$charset_collate = $wpdb->get_charset_collate(); | |
$createTable = "CREAT TABLE IF NOT EXISTS $table ( | |
ID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, | |
stockID VARCHAR(12) NOT NULL, | |
stockName VARCHAR(50) NOT NULL, | |
action VARCHAR(12) NOT NULL, | |
entryDate VARCHAR(12) NOT NULL, | |
exitDate VARCHAR(12) NOT NULL, | |
entryPrice VARCHAR(12) NOT NULL, | |
exitPrice VARCHAR(12) NOT NULL, | |
targetPrice VARCHAR(12) NOT NULL, | |
stopLoss VARCHAR(12) NOT NULL, | |
callStartDate TIMESTAMP | |
)$charset_collate;"; | |
// Check if database is created | |
if($wpdb->query($createTable) === TRUE) | |
{ | |
echo "table created successfully."; | |
} | |
else { | |
echo $wpdb->print_error(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment