SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple Insert Error

    Here is the statement.

    INSERT INTO Games (name, description, cover, url, release, esrb, developer, publisher, genre, platform) VALUES ('Mass Effect 2', 'The second installment in the Mass Effect trilogy Mass Effect 2 is developed by BioWare and published by EA Games for Xbox 360 and PC. It is currently slated for release on January 26 2010.', '1255414-masseffect2boxart_large.jpg', 'mass-effect-2', '2010-01-26', 5, 7, 1, 1, '14')

    Here is the error.

    #1064 - 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 'release, esrb, developer, publisher, genre, platform) VALUES ('Mass Effect 2', '' at line 1

    Here is the table.

    id int(11)
    name varchar(100)
    description text
    cover varchar(100)
    release varchar(50)
    url varchar(100)
    esrb int(11)
    developer int(11)
    publisher int(11)
    genre int(11)
    platform varchar(50)

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    http://dev.mysql.com/doc/refman/5.1/...ved-words.html

    RELEASE is a reserved word and can't be used as an object name (table/column/etc) unless you always enclose it in backticks.

    You should name that column something else.

  3. #3
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Dan.
    Renaming the field fixed the error.


Bookmarks

Posting Permissions

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