Please help me! "You have an error in your SQL syntax"

Discussion in 'MySQL' started by apex2009, Aug 1, 2009.

  1. #1
    please help... my VBULLETIN 3.8.3 has encounter an error... huhuhuhu.. i dont no wat to do... huhuhuhu

    mySQL query error: SELECT gid, gname FROM games_list WHERE
     gname='Bart's Watersports Adventure (Dechevious)'
    
    mySQL 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 's Watersports Adventure (Dechevious)'' at line 1
    
    mySQL error code: 
    Date: Saturday 01st 2009f August 2009 03:54:00 AM
    HTML:
    [​IMG]

    it happens wen i install a game in my arcade... please help... please

    i installed this one: Bart's Watersports Adventure (Dechevious)

    THANK YOU so much in ADVANCED!!
     
    Last edited: Aug 1, 2009
    apex2009, Aug 1, 2009 IP
  2. bbosh

    bbosh Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The apostrophe is closing the string, so the text after the second quote is treated as SQL (which, is invalid). You will need to escape the quote:

    mySQL query error: SELECT gid, gname FROM games_list WHERE
     gname='Bart\'s Watersports Adventure (Dechevious)'
    Code (markup):
    The software is not secure, particularly if used by normal users. It could be exploited by SQL Injection.
     
    bbosh, Aug 1, 2009 IP
  3. apex2009

    apex2009 Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    wat should i do??? i dont know where to go.... where should i edit the file??? i just installed the game in my arcade....

    Please help me.. can u give a Step by steps??? please.. thank you so much....
     
    apex2009, Aug 1, 2009 IP
  4. Love*

    Love* Well-Known Member

    Messages:
    1,739
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    165
    Digital Goods:
    1
    #4
    Backslash your apostrophe, example:
    gname='Bart\'s Watersports Adventure (Dechevious)'
     
    Love*, Aug 1, 2009 IP
  5. apex2009

    apex2009 Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yes i understand... but where should i edit this?? i have just installed a games ang got error..

    where should i find the CODE??? where should i edit it in my vbulletin 3.8.3.. please help...

    By the way thanks for the help....
     
    apex2009, Aug 1, 2009 IP
  6. Love*

    Love* Well-Known Member

    Messages:
    1,739
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    165
    Digital Goods:
    1
    #6
    Well, I don't have vbulletin so I don't know where you should edit, but just uninstall the game?
     
    Love*, Aug 1, 2009 IP
  7. apex2009

    apex2009 Peon

    Messages:
    35
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thank you for all your effort... i really appreciate all your comment n suggestion. to solved the problem, wat i have done is to uninstalled the arcade and delete all the files from the directory and also in the database and after that i installed it again... that's all, problem solved...

    thanks again....
     
    apex2009, Aug 1, 2009 IP
  8. ASPMachine

    ASPMachine Peon

    Messages:
    723
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Probably the problem could be for sql syntax error. Can you show the code that you're using for this?
     
    ASPMachine, Aug 3, 2009 IP
  9. ditigalass

    ditigalass Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    a possible solution next time this happens is to type
    mysql on the command line

    once you get the CL you will notice now it says mysql. Now your in the mysql command line and can follow the instructions the other poster provided. mysql is VERY particular about whitespace and closing quotes, check your work if you get an error it is 100% usually related to an extra space or a non closed arguement or phrase.. I find that if I'm creating the same tables over and over again that I simply copy it onto a notepad and save it for future reference rather then remembering it by memory all the time
     
    ditigalass, Aug 3, 2009 IP
  10. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The arcade script you're using is insecure, I would advise against using it. It allows for SQL injection attack which can compromise (delete) your entire DB. Proceed with caution.
     
    premiumscripts, Aug 4, 2009 IP
  11. shaibibutt

    shaibibutt Member

    Messages:
    606
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    35
    #11
    try this
    gname='Bart\'s Watersports Adventure (Dechevious)'
     
    shaibibutt, Aug 4, 2009 IP
  12. cignusweb

    cignusweb Peon

    Messages:
    147
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    should you use query link this
    mySQL query error: SELECT gid, gname FROM games_list WHERE
    gname='."Bart\'s."' Watersports Adventure (Dechevious)'
     
    cignusweb, Aug 5, 2009 IP