php中向MySQL数据库中更新数据出现错误

来源:百度知道 编辑:UC知道 时间:2024/05/25 17:25:34
$sql="update storer set question='".$question."',type='".$type."',sbnum='".$sbnum."',option1='".$option1."',option2='".$option2."',option3='".$option3."',option4='".$option4."',keys='".$keys."' 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 'keys='属性' where id='1'' at line 1 备注:属性是keys键的一个值 求教高手,怎么找出错误?

$sql="update storer set question='{$question}',type='{$type}',sbnum='{$sbnum}',option1='{$option1}',option2='{$option2}',option3='{$option3}',option4='{$option4}',`keys`='{$keys}' where id='{$id}'";

可能是编码问题,你数据库编码是什么 ?