Deleting a database row with mysql - getting an error!?

Posted by Nike on Stack Overflow See other posts from Stack Overflow or by Nike
Published on 2010-04-19T11:55:07Z Indexed on 2010/04/19 12:13 UTC
Read the original article Hit count: 253

Filed under:
|
|

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='nike1'' 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.

Thanks. -Nike

© Stack Overflow or respective owner

Related posts about mysql

Related posts about delete