Can't run code on activation
-
Hello All,
I’ve scoured the net and read several tutorials that write the same code and I can’t figure out why my code, which is exactly the same, won’t run:
function WPMUSAS_plugin_install(){ global $wpdb; $table_name = $wpdb->prefix . "wpmusas"; if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name){ $sql = "CREATE TABLE $table_name ( ID int(5) NOT NULL AUTO_INCREMENT, country VARCHAR(255) DEFAULT '' NOT NULL, shipping VARCHAR(255) DEFAULT '' NOT NULL, UNIQUE KEY id (id) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } } register_activation_hook(__FILE__, 'WPMUSAS_install');I’ve also tried
trigger_error('TESTING', E_USER_ERROR);but even that just results in a “The plugin generated 238 characters of unexpected output during activation.” error message at the top.What am I missing?
The topic ‘Can't run code on activation’ is closed to new replies.