Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6173053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:30:03+00:00 2026-05-23T23:30:03+00:00

I am currently working on a plugin for personal use, but I just can’t

  • 0

I am currently working on a plugin for personal use, but I just can’t get the plugin to create a table, I try activation the plugin but it doesn’t create a table here is my code:

team-monobattle-registraion.php:

<?php
/*
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() {
    include('team-monobattle-admin.php');
}

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');

include('team-monobattle-database.php');

register_activation_hook(__FILE__, 'tmbr_install');
?>

team-monobattle-database.php:

<?php

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)
    );";

    dbDelta($sql);

    echo('installed');
    }

}
?>

team-monobattle-admin.php:

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

Help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:30:04+00:00Added an answer on May 23, 2026 at 11:30 pm

    The variables have to be inside your function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first jQuery plugin. Can I get some pointers? It's currently not
Here I am working with jquery data table plugin in asp.net page I'm currently
I'm currently working on a jQuery plugin and I'm wondering if it would be
I am currently working with the jQuery validation plugin , and I want to
I'm currently working at a WordPress Plugin. It supports shortcode and creates DOM elements,
I'm currently working on a wordpress 2.9.2 plugin (my first) that creates additional custom
I'm currently working on a port of a jEdit plugin to write all code
i'm currently working on a Eclipse RCP Project. I have a Plugin Fragment where
I'm currently working on a search box for my site that will hopefully use
Currently i am working on a plugin and widget based CMS. A widget is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.