Jump to content

[SOLVED] You have an error in your SQL syntax; check the manual that corresponds to your


Recommended Posts

Why am I getting the error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; CREATE TABLE bans ( id int unsigned NOT NULL auto_increment, ' at line 4" for this simple query?

 

<?php
    mysql_query("
      CREATE TABLE admin (
      adminpassword text NOT NULL,
      PRIMARY KEY (adminpassword)
    );

    CREATE TABLE bans (
      id int unsigned NOT NULL auto_increment,
      ip text NOT NULL,
      PRIMARY KEY (id)
    );

    CREATE TABLE censors (
      id int unsigned NOT NULL auto_increment,
      word text NOT NULL,
      PRIMARY KEY (id)
    );

    CREATE TABLE config (
      name text NOT NULL,
      value text NOT NULL,
      PRIMARY KEY (name)
    );

    CREATE TABLE shouts (
      id int unsigned NOT NULL auto_increment,
      name text NOT NULL,
      message text NOT NULL,
      ip text NOT NULL,
      PRIMARY KEY (id)
    );

    CREATE TABLE styles (
      name text NOT NULL,
      value text NOT NULL,
      PRIMARY KEY (name)
    );

    INSERT INTO admin (adminpassword) VALUES ('admin123');

    INSERT INTO bans (ip) VALUES ('123.456.7.89');

    INSERT INTO censors (word) VALUES ('fuck');
    INSERT INTO censors (word) VALUES ('shit');
    INSERT INTO censors (word) VALUES ('cunt');
    INSERT INTO censors (word) VALUES ('bitch');
    INSERT INTO censors (word) VALUES ('nigger');
    INSERT INTO censors (word) VALUES ('coon');
    INSERT INTO censors (word) VALUES ('spic');
    INSERT INTO censors (word) VALUES ('beaner');
    INSERT INTO censors (word) VALUES ('gook');
    INSERT INTO censors (word) VALUES ('chink');

    INSERT INTO config (name, value) VALUES ('numshouts', '20');
    INSERT INTO config (name, value) VALUES ('maxname', '25');
    INSERT INTO config (name, value) VALUES ('maxshout', '255');
    INSERT INTO config (name, value) VALUES ('wrapwords', '20');
    INSERT INTO config (name, value) VALUES ('usecookies', 'yes');
    INSERT INTO config (name, value) VALUES ('smilies', 'yes');

    INSERT INTO shouts (name, message, ip) VALUES ('Dion Design', 'Congrats! It appears your Shoutboxer has been installed successfully!', '123.456.7.89');

    INSERT INTO styles (name, value) VALUES ('bannedtxtcolor', '#FFFFFF');
    INSERT INTO styles (name, value) VALUES ('maintxtcolor', '#000000');
    INSERT INTO styles (name, value) VALUES ('maintxtfont', 'Verdana');
    INSERT INTO styles (name, value) VALUES ('maintxtsize', '8');
    INSERT INTO styles (name, value) VALUES ('boxbordercolor', '#306099');
    INSERT INTO styles (name, value) VALUES ('boxbordersize', '1');
    INSERT INTO styles (name, value) VALUES ('boxborderstyle', 'solid');
    INSERT INTO styles (name, value) VALUES ('headerbgcolor', '#306099');
    INSERT INTO styles (name, value) VALUES ('headertxtcolor', '#FFFFFF');
    INSERT INTO styles (name, value) VALUES ('formbgcolor', '#306099');
    INSERT INTO styles (name, value) VALUES ('inputbgcolor', '#FFFFFF');
    INSERT INTO styles (name, value) VALUES ('inputbordercolor', '#BFBFBF');
    INSERT INTO styles (name, value) VALUES ('inputbordersize', '1');
    INSERT INTO styles (name, value) VALUES ('inputtxtcolor', '#000000');
    INSERT INTO styles (name, value) VALUES ('row1bgcolor', '#DFDFDF');
    INSERT INTO styles (name, value) VALUES ('row2bgcolor', '#EFEFEF');
    INSERT INTO styles (name, value) VALUES ('headerwriting', 'Shoutboxer');
    INSERT INTO styles (name, value) VALUES ('shoutbuttonvalue', 'Shout it!');
    ") or die(mysql_error());
?>
[code]

[/code]

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.