我试图做一个非常简单的更新与PHP,像这样:MySQL的问题与更新号
$nlk = $lk + "1";
mysql_query("UPDATE posts SET like = '".$nlk."' WHERE id = '".$cid."'") or die(mysql_error());
$lk
是从外地like
,这是默认0
得到的值。 $cid
是来自id
字段的值,该字段位于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
什么是这里的问题?
这是* *在单引号。 – jackbot 2011-03-28 15:53:24