Plugin could not be activated because it generated 2 chars of unexpected output
-
Hi guys,
I can not activate my plugin it shows error msg like this
“Plugin could not be activated because it generated 2 characters of unexpected output”
Here is is my test snippet:
<?php
// Plugin Name: test test test
?>
<?phpfunction create_table()
{
global $wpdb;
$table_name = $wpdb->prefix . “test_test_test”;
if($wpdb->get_var(“show tables likes ‘$table_name'”) != $table_name){
$myquery = “CREATE TABLE “.$table_name.” (
ID int(10) NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL
);”;
require_once(ABSPATH . ‘/wp-admin/includes/upgrade.php’);
dbDelta($myquery);
}
}
register_activation_hook( _FILE_,’create_table’);?>
I dont why, i’ve google for an hour and still didnt find solution,
Anyone please ?
Thank you
- The topic ‘Plugin could not be activated because it generated 2 chars of unexpected output’ is closed to new replies.