我试图用PHP做一个非常简单的UPDATE。
$nlk = $lk + "1";
mysql_query("UPDATE posts SET like = ".$nlk." WHERE id = ".$cid." ") or die(mysql_error());
$lk
is a the value gotten from the field like
, which is default 0
.
$cid
is a value from an id
field, which is on auto_increment
.
我发现这一错误:
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 like = 1 WHERE id = 45 at line 1
这里的问题是什么?