Results 1 to 4 of 4

Thread: Mysql error

  1. #1
    facemashaliens is offline Junior Member
    Join Date
    May 2012
    Posts
    3

    Default Mysql error

    When I insert this:

    Code:
    CREATE TABLE IF NOT EXISTS `battles` (
       `battle_id` bigint(20) unsigned NOT NULL auto_increment,
       `winner` bigint(20) unsigned NOT NULL,
       `loser` bigint(20) unsigned NOT NULL,
       PRIMARY KEY  (`battle_id`),
       KEY `winner` (`winner`)
      ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     
     
      CREATE TABLE IF NOT EXISTS `images` (
       `image_id` bigint(20) unsigned NOT NULL auto_increment,
       `filename` varchar(255) NOT NULL,
       `score` int(10) unsigned NOT NULL default '1500',
       `wins` int(10) unsigned NOT NULL default '0',
       `losses` int(10) unsigned NOT NULL default '0',
       PRIMARY KEY  (`image_id`)
      ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
    It gave me this error message:

    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 '' at line 1

    When I ran it through a syntax checker, it told me:
    PHP Syntax Check: Parse error: syntax error, unexpected T_STRING in your code on line 1

    Could anybody help?
    Last edited by saitfainder; 05-22-2012 at 10:00 AM.

  2. #2
    saitfainder's Avatar
    saitfainder is offline AlterVista Staff
    Join Date
    Feb 2010
    Posts
    300

    Default

    That queries are syntactically correct. How are you launching them on the database server? With PhpMyAdmin?
    "Over thinking, over analyzing separates the body from the mind."

  3. #3
    facemashaliens is offline Junior Member
    Join Date
    May 2012
    Posts
    3

    Default

    Yes, I'm using PhpMyAdmin.

  4. #4
    facemashaliens is offline Junior Member
    Join Date
    May 2012
    Posts
    3

    Default

    I was using this tutorial: http://www.xboxmb.com/forum/52-progr...-tutorial.html if that helps to find the error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO