I am developing a plugin that I would like to have a table created when it is activated. When I activate the plugin, I am seeing that the table is being created successfully, however, I am getting the following message.
The plugin generated 20 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
Here is my code, any help is appreciated...
<?php
function pfw_activate_plugin(){
if(version_compare(get_bloginfo('version'), '4.8', '<')){
wp_die(__('You must update wordpress to use this plugin','pfw-members'));
}
global $wpdb;
$createSQL = "
CREATE TABLE `" . $wpdb->prefix. "pfw_person` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`first_name` VARCHAR(50) NOT NULL COLLATE utf8_bin,
`last_name` VARCHAR(75) NOT NULL COLLATE utf8_bin,
`user_id` INT(11) NOT NULL,
`person_type` VARCHAR(50) NOT NULL COLLATE utf8_bin,
`create_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB " . $wpdb->get_charset_collate() . " AUTO_INCREMENT=1;";
require_once(ABSPATH . '/wp-admin/includes/upgrade.php');
dbDelta($createSQL);
}
?>