SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Feb 2004
    Location
    Manchester, UK
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Mystery Syntax error on query that used to work!!!

    I'm really confused with this one so hoping someone can help! I have an insert query that has been working fine for years but has now stopped working as it just throws up a syntax error. The section of code concerned is:

    INSERT INTO posters (pic,film_id,Title,country_id,Year,Size,Condition, Comments, actors, marques, Keywords, Price, stock,bargain,nonmovie, halfprice,`Date`)

    The syntax error is near 'Condition, Comments,actors....'

    Any ideas.... I'm really getting frustrated with this - as is my client whose site it's on!

    Thanks!
    Puppygreen Print
    Full Colour Print for less than you'd think!
    www.puppygreenprint.com

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    It looks like it has a problem with Size
    Whack it into backticks and see what happens

    Code:
    INSERT INTO posters (pic,film_id,Title,country_id,Year,`Size`,Condition, Comments, actors, marques, Keywords, Price, stock,bargain,nonmovie, halfprice,`Date`)
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Member
    Join Date
    Feb 2004
    Location
    Manchester, UK
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    It looks like it has a problem with Size
    Whack it into backticks and see what happens

    Code:
    INSERT INTO posters (pic,film_id,Title,country_id,Year,`Size`,Condition, Comments, actors, marques, Keywords, Price, stock,bargain,nonmovie, halfprice,`Date`)
    Thanks, I thought it might be that but it doesn't seem to make a difference - it still throws up the same syntax error!
    Puppygreen Print
    Full Colour Print for less than you'd think!
    www.puppygreenprint.com

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    my bad - CONDITION is a reserved word and should be in backticks!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Member
    Join Date
    Feb 2004
    Location
    Manchester, UK
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks that's sorted it!

    One of the reasons I love living in Manchester - the helpful people!
    Puppygreen Print
    Full Colour Print for less than you'd think!
    www.puppygreenprint.com

  6. #6
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    lol, glad I could help

    Off Topic:


    Where abouts in Manchester are you?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Off Topic:


    Where abouts in Manchester are you?
    Off Topic:

    i'm at the rover's return on coronation street
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    I remember that you are a Corrie fan Rudy but a long way behind
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  9. #9
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you work out why it was working for years and then stopped?
    |
    Add Your Robotics site to my Robot Directory: submit
    |
    Add Your Las Vegas Website to my Las Vegas Directory: submit

  10. #10
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    the host probably upgraded mysql to a version where CONDITION is a reserved word.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  11. #11
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    thats usually the case for most scripts that have worked for years and then stop!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  12. #12
    SitePoint Member
    Join Date
    Feb 2004
    Location
    Manchester, UK
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think my hosts did upgrade MySQL and I wasn't aware that it made such a difference!

    SpikeZ - I'm based in the Northern Quarter.. so if you need any printing...
    Puppygreen Print
    Full Colour Print for less than you'd think!
    www.puppygreenprint.com

  13. #13
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd blame it on the new foreign owners of Manchester City. ;-)


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
  •