I still don't understand. Here is what I have...
| Code: : |
$pr_db_version = "1.0";
function pr_db_install () {
global $wpdb;
global $pr_db_version;
//Concat Wordpress DB prefix to table name and Assign Table Names to Variables
$pr_orders = $wpdb->prefix . "pr_orders";
$pr_vendors = $wpdb->prefix . "pr_vendors";
$pr_approvals = $wpdb->prefix . "pr_approvals";
$pr_items = $wpdb->prefix . "pr_items";
wp_pear_debug::add($pr_orders);
//Check if pr_orders table already exist and create if not
if($wpdb->get_var("SHOW TABLES LIKE '$pr_orders'") != $pr_orders){
$sql = "CREATE TABLE " . $pr_orders . " (
id mediumint(9) NOT NULL AUTO_INCREMENT,
time bigint(11) DEFAULT '0' NOT NULL,
name tinytext NOT NULL,
text text NOT NULL,
url VARCHAR(55) NOT NULL,
UNIQUE KEY id (id)
);";
wp_pear_debug::add($sql);
//dbDelta($sql);
}
}
register_activation_hook(__FILE__,'pr_db_install');
|
Yet when I look in the logs and messages I don't see the outputs of those variables. Where should they be?
While I got your attention. Any idea why using dbDelta with the above code causes my code to break. I am getting:
| Code: : |
Fatal error: Cannot redeclare pr_db_install() (previously declared in /wp-content/plugins/purchase-request/pr_main.php:18) in /wp-content/plugins/purchase-request/pr_main.php on line 46
|