What's wrong with this MySQL query?
Posted: Sat Aug 06, 2005 6:37 am
I'm making a trivia game project, and now am working on the Admin CP.
The part I'm on now is the part where the administrator adds a question to a table on a DB:
PHP generates the following error:
Parse error: syntax error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [filename]
Thanks.
The part I'm on now is the part where the administrator adds a question to a table on a DB:
Code: Select all
mysql_query("INSERT INTO questions (author, category, query, answer_a, answer_b, answer_c, correct) VALUES ($_POST[\'author\'], $_POST[\'category\'], $_POST[\'query\'], $_POST[\'answer_a\'], $_POST[\'answer_b\'], $_POST[\'answer_c\'], $_POST[\'correct\']");Parse error: syntax error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [filename]
Thanks.