Multiple Database Tables for Plugin
-
On activation I’m trying to have WP create 2 tables that my ‘plugin’ will need. I’ve tried using deltadb() and wpdb->query.
The SQL is properly formed (literally just a cut and paste out of a MySQL 4.0 export).
I either get 1 table created or none respectively. Where am I going wrong?
require_once(ABSPATH . "wp-admin/upgrade-functions.php");
// if database table doesn't already exist
if ($installed_ver === false || $installed_ver != $plugin_db_version) {$sql_one = "CREATE TABLE " . $this->db_table_one . " (
<FIELDS>
) TYPE=InnoDB;";
dbDelta($sql_one);$sql_two = "CREATE TABLE " . $this->db_table_two . " (
<FIELDS>
) TYPE=InnoDB;";
dbDelta($sql_two);
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Multiple Database Tables for Plugin’ is closed to new replies.