I'm presently focusing on a wordpress plugin for private use, however i cannot obtain the wordpress plugin to produce a table, I attempt activation the wordpress plugin however it does not produce a table here's my code:


Plugin Name: Team Monobattle Registration
Plugin URI: http://www.web-geeks.com/
Description: Plugin for registering teams for monobattles.
Author: Web-geeks
Version: 1.0
Author URI: http://www.web-geeks.com/

function tmbr_admin() {

function tmbr_admin_actions() {
    add_options_page('Team Monobattle Registration', 'Team Monobattle Registration', 'manage_options', 'tmbr', 'tmbr_admin');

add_action('admin_menu', 'tmbr_admin_actions');


register_activation_hook(__FILE__, 'tmbr_install');



global $tmbr_db_table_version;
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
$tmbr_db_table_version = "1.0";
global $wpdb;

function tmbr_install()

    global $tmbr_db_table_version;
    $installed_ver = get_option( "tmbr_db_table_version" );

    if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != 'wp_teammonobattleteams' ||  $installed_ver != $tmbr_db_table_version ) {

    $sql = "CREATE TABLE wp_teammonobattleteams (
    teamid mediumint(9) NOT NULL AUTO_INCREMENT,
    teamname tinytext NOT NULL,
    pname1 tinytext NOT NULL,
    pid1 smallint NOT NULL,
    pname2 tinytext NOT NULL,
    pid2 smallint NOT NULL,
    pname3 tinytext NOT NULL,
    pid3 smallint NOT NULL,
    pname4 tinytext NOT NULL,
    pid4 smallint NOT NULL,
    UNIQUE KEY id (id)





<div class="wrap">
<?php    echo "<h2>" . __( 'Team Monobattle Admin', 'tmbr_admin' ) . "</h2>"; ?>

Help appreciated, Techy

The variables need to be within your function.