我应该怎么做这个错误?这是我的问题:
UPDATE person
SET
Name = '$Name',
Address = '$Address',
Email = '$Email',
Telephone = '$Telephone',
WHERE Id = '$Id';
但在执行时会出现这种错误:
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
'WHERE Id = '$Id' at line 2
答案 0 :(得分:3)
问题在这里
, WHERE Id
他们是查询中WHERE
之后的额外逗号,将其删除。所以查询就像:
"UPDATE person SET Name = '$Name' , Address = '$Address' , Email = '$Email' , Telephone = '$Telephone' WHERE Id = '$Id' ;"