0

Error

INSERT INTO PENILAIAN (ID,KURSUSID,QUEST1,QUEST2,QUEST3,QUEST4,QUEST5,QUEST6,QUEST7,QUEST8,QUEST9,QUEST10)VALUES ('951019105851', ''13'', '1', '2', '3', '4', '4', '5', '4', '5', '4', '5')

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 '13'', '1', '2', '3', '4', '4', '5', '4', '5', '4', '5')' at line 3

code

"INSERT INTO PENILAIAN (ID,KURSUSID,QUEST1,QUEST2,QUEST3,QUEST4,QUEST5,QUEST6,QUEST7,QUEST8,QUEST9,QUEST10)VALUES
('$login_sessionID',
'$kid','$QUEST1','$QUEST2','$QUEST3','$QUEST4','$QUEST5','$QUEST6','$QUEST7','$QUEST8','$QUEST9','$QUEST10')";
2
  • 3
    ('951019105851', ''13'', note the double single quote. Apparently , you already quoted the $kid variable Commented Jan 11, 2016 at 12:30
  • Use prepared statements Commented Jan 11, 2016 at 12:31

2 Answers 2

1

Error simply guides you

''13''
 ^  ^

there is additional single quote

  1. keep only one ' pair for code
  2. Use prepared statements
Sign up to request clarification or add additional context in comments.

1 Comment

Happy to help :)
0

I think you have double quotes on ''13''. olso i want to ask, does any of the values contain quotes? like this (I'am x) if you use quotes you should use mysql_real_escape_string when you POST

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.