Closed Thread
Results 1 to 7 of 7

Thread: Help needed. SQL error?

  1. #1
    TMG
    TMG is offline Newbie
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Help needed. SQL error?

    QUERY 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 ' 0, '', 'This is a test crime', 'Crime finished, You own!', 'Crime Failed, You a' at line 1
    Query was

    Code:
    INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeJAILTIME, crimeJREASON, crimeXP) VALUES( 'Test Crime', '0', '((WILL*0.8)/2.5)+(LEVEL/4)', '', , 0, '', 'This is a test crime', 'Crime finished, You own!', 'Crime Failed, You are a failure', 'You got caught by the blue', 0, 'noob', 500);
    Any idea what I can do to fix this?
    Last edited by Jaan; 01-30-2010 at 04:17 AM. Reason: Please use code tags when you are posting your codes!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: Help needed. SQL error?

    yes, before that zero, you have two commas, without a value, I assume it want a value there.
    __________________________________________
    I study Information Systems at Karlstad University when I'm not on CodeCall

  4. #3
    TMG
    TMG is offline Newbie
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Re: Help needed. SQL error?

    I dont really understand what to do now xD

  5. #4
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: Help needed. SQL error?

    you have to insert a zero, a null or a '' there, depending on the field type
    __________________________________________
    I study Information Systems at Karlstad University when I'm not on CodeCall

  6. #5
    TMG
    TMG is offline Newbie
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Re: Help needed. SQL error?

    Okay, So far I understand, But I dont know where to insert that.
    I suppose at the database, Yet I dont know where in the database.

  7. #6
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Help needed. SQL error?

    Orjan was refering to your query:
    INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeJAILTIME, crimeJREASON, crimeXP) VALUES( 'Test Crime', '0', '((WILL*0.8)/2.5)+(LEVEL/4)', '', , 0, '', 'This is a test crime', 'Crime finished, You own!', 'Crime Failed, You are a failure', 'You got caught by the blue', 0, 'noob', 500)
    INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeJAILTIME, crimeJREASON, crimeXP) VALUES( 'Test Crime', '0', '((WILL*0.8)/2.5)+(LEVEL/4)', '', -----HERE-----, 0, '', 'This is a test crime', 'Crime finished, You own!', 'Crime Failed, You are a failure', 'You got caught by the blue', 0, 'noob', 500)
    Where " -----HERE-----" is needs to be a value of something, you can't leave it blank. In some of the fields you put '' but that one is blank which is why it's giving you an error you should put " -----HERE-----" as a blank string, throw in a numeric number (zero) or something so it doesn't give you an error

  8. #7
    TMG
    TMG is offline Newbie
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Re: Help needed. SQL error?

    Oh okay! Got it fixed!
    Thank you!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 11-07-2011, 08:13 PM
  2. Replies: 5
    Last Post: 06-20-2010, 10:52 PM
  3. Replies: 1
    Last Post: 06-18-2010, 05:26 AM
  4. My error-free code has an error. (Switches/Cases)
    By Sundosia in forum C and C++
    Replies: 3
    Last Post: 08-07-2008, 12:16 PM
  5. Replies: 1
    Last Post: 05-06-2008, 05:16 AM

Tags for this Thread

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