• 0

[MYSQL] Help with sql statement


Question

I need help with this line of sql. Ive been trying at it for the past 3 hours. Its so simple yet I can't seem to find out what the error is.

Errror: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 'option, option_num) VALUES('1', '1',' 1')' at line 1

Grief bearing mysql:mysql_query("INSERT INTO poll_options (poll_id, option, option_num) VALUES('$poll_id', '$option', '$option_num')") or die(mysql_error());

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Option is a reserved MySQL word. This should fix it.

mysql_query("INSERT INTO poll_options (poll_id, `option`, option_num) VALUES ('$poll_id', '$option', '$option_num')") or die(mysql_error()); 

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.