Hey all,
I'm having an issue. I can successfully create a single table (for a plugin I'm writing) in the WP database. however, I need to create *two* tables - not just one. However, I can only get one to take.
Basically, I'm trying to pull this off:
function install_tables () {
global $wpdb;
$sales = $wpdb->prefix . "sales";
$settings = $wpdb->prefix . "settings";
if($wpdb->get_var("show tables like '$sales'") != $sales) {
$sql = "CREATE TABLE " . $sales . " (
// blah blah whole bunch of info here
);
CREATE TABLE " . $settings . " (
// blah blah second table info here
); ";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
}
register_activation_hook(__FILE__,'install_tables');
Okay, so the "sales" table is creating just fine, but the "settings" is being completely ignored. I've tried different variations to get this to work, and can't.
Anyone know what I'm doing wrong?