我希望所有具有特定值的字段都改为不同的值。更改mysql表中的字段?
,但我的代码给了我一个错误
UPDATE maps
SET city_id = $new_id
WHERE city_id = $old_id
你不能写这样呢?
我得到这个错误代码:
Couldn't execute query: 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 '' at line 3
你可能需要在引号中加上''$ newName''。 – 2010-02-17 22:15:44
其实这些应该是ID的...我改变它 – ajsie 2010-02-17 22:16:49
问题是试图取代你用来找到记录 – 2010-02-17 22:19:57