I wrote this code:
mysql_query("INSERT INTO test (user_id, word_id, right) VALUES ('6', '23', '5' )") or die(mysql_error());
But an error message prompts:
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 ‘right) VALUES (‘6′, ’23’, ‘5’ )’ at line 1
What I did wrong?
rightis a reserved word , escape it like so:Note that:1
1:quoted from PHP Manual: mysql_query