Here’s the code:
mysql_query("DELETE " . $_GET['id'] . " FROM forum_favorites WHERE thread_id='" . $_GET['id'] . "' AND user='" . $userinfo['username'] . "'") or die(mysql_error());
And the error message:
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 ’77 FROM
forum_favorites WHERE thread_id=’77’
AND user=’user” at line 1
Anyone knows what’s up here? I’ve been stuck here for hours now and i just can’t figure out what the heck’s wrong? The database name and the column names are correct.
Remove
" . $_GET['id'] . "betweenDELETEandFROM:See the documentation for DELETE for more information.
Note that your code may also be vulnerable to SQL injection attacks. I’d suggest reading this question and the answers there.