SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast zink's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Sql Insert Error

    Hi all

    Having a major problem with this very simple SQL INSERT. Getting the classic error but just can't work out why I'm getting it.

    Code MySQL:
    INSERT INTO return VALUES('','274','Via','Shepton Mallet','fghgfg','45','test','test','1')

    Produces this error:

    Code:
    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 'return VALUES('','274','Via','Shepton Mallet','fghgfg','45','test','t' at line 1
    I am not a beginner by any means and have had this error many times before but the usual fix is not the problem.

    Errr WTF, please help

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    700
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    return is a reserved word in SQL. Either rename the table or enclose it in `` i.e.

    Code:
    `return`

  3. #3
    SitePoint Enthusiast zink's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL of course it is

    I knew it was something obvious like that!

    thanks for your help swamp


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
  •