register_activation_hook() not activate plugin

Works perfectly when this code is in main plugin file:

<?php
function createTable(){
    global $wpdb;
    $query = "CREATE TABLE IF NOT EXISTS " . $wpdb->prefix ."UsersExtra (
        user_id INT NOT NULL,
        first_name VARCHAR(25) NOT NULL,
        last_name VARCHAR(25) NOT NULL,
        address VARCHAR(80) NOT NULL,
        city VARCHAR(30) NOT NULL,
        province CHAR(2) NOT NULL,
        postcode CHAR(7) NOT NULL,
        interests TEXT NULL,
        bio TEXT NULL,
        signature TEXT NULL,
        skills TEXT NULL,
        PRIMARY KEY (user_id),
        FULLTEXT KEY (interests, skills)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8";
    $wpdb->query($query);
}
register_activation_hook(__FILE__, 'createTable');

Leave a Comment

error code: 523