need help with mysql...

Discussion in 'Site & Server Administration' started by thebitbotdotcom, Feb 26, 2010.

  1. #1
    I am trying to install an new script, but the script does not install a database prefix upon initial installation. MySQL database table names are of limited supply, so I really need to put a prefix on these tables. Here is the original installation script. I was told to modify this by the author:

    global $table;

    $table=array();
    define('TABLE_PREFIX','');

    $table['categories']=TABLE_PREFIX . 'categories';
    $table['items']=TABLE_PREFIX . 'link';
    $table['options']=TABLE_PREFIX . 'options';
    $table['comments']=TABLE_PREFIX . 'comments';
    $table['ratings']=TABLE_PREFIX . 'ratings';
    $table['rating']=TABLE_PREFIX . 'rating';
    $table['contacts']=TABLE_PREFIX . 'contacts';
    $table['hits']=TABLE_PREFIX . 'hits';
    $table['admin_area']=TABLE_PREFIX . 'admin_area';
    $table['payments']=TABLE_PREFIX . 'payments';

    How do I modify this so that I have a prefix on all of the tables installed???

    HELP!!!
     
    thebitbotdotcom, Feb 26, 2010 IP
  2. Shagoon

    Shagoon Notable Member

    Messages:
    596
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    220
    #2
    Replace TABLE_PREFIX with your prefix, let's say you would want vb_ as prefix you would have:

    $table['categories']= 'vb_' . 'categories';
    or
    $table['categories']= 'vb_categories';
     
    Shagoon, Feb 26, 2010 IP
  3. thebitbotdotcom

    thebitbotdotcom Peon

    Messages:
    349
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I tried both of your suggestions, but still no prefix. Am I supposed to change this too?

    $table=array();
    define('TABLE_PREFIX','');
     
    thebitbotdotcom, Feb 26, 2010 IP
  4. thebitbotdotcom

    thebitbotdotcom Peon

    Messages:
    349
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Actually, here is everything...what's missing?

    global $table;

    $table=array();
    define('TABLE_PREFIX','vb_');

    $table['categories']= 'vb_categories';
    $table['link']='vb_link';
    $table['options']='vb_options';
    $table['comments']='vb_comments';
    $table['ratings']='vb_ratings';
    $table['rating']='vb_rating';
    $table['contacts']='vb_contacts';
    $table['hits']='vb_hits';
    $table['admin_area']='vb_admin_area';
    $table['payments']='vb_payments';
    $table['mailreports']='vb_mailreports';
    $table['mailtemplates']='vb_mailtemplates';
     
    Last edited: Feb 26, 2010
    thebitbotdotcom, Feb 26, 2010 IP