Jump to content

error in my query


ohdang888

Recommended Posts

From the code below, i am getting this error:

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 ''1' = 0 WHERE `id`='5'' at line 1

 

whats wrong with my query?

 

BTW, in this case, $field = 1


if($action = 'deny'){
mysql_connect("localhost", "root", "pancakes1") or die(mysql_error());
mysql_select_db("members") or die(mysql_error());

mysql_query("UPDATE `friend_requests` SET '{$field}' = 0 WHERE `id`='{$id}' ") or die(mysql_error());

Echo 'Friend Request Successfully Denied';
}

Link to comment
https://forums.phpfreaks.com/topic/94189-error-in-my-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.