[英]What's wrong with this sql code?
如果我删除行condition=\\''.$this->condition.'\\',
它可以工作。
如果我在那里,会出现以下错误消息:
您的SQL语法有错误; 查看与您的MySQL服务器版本对应的手册,以便在'condition ='unknown',promotional ='0',website ='0',quantity ='1','在第7行附近使用正确的语法
mysql_query('UPDATE products SET
name = \''.$this->name.'\',
description = \''.$this->description.'\',
brand = \''.$this->brand.'\',
model = \''.$this->model.'\',
price=\''.$this->price.'\',
condition=\''.$this->condition.'\',
promotional=\''.$this->promotional.'\',
website=\''.$this->website.'\',
quantity=\''.$this->quantity.'\',
service=\''.$this->service.'\'
WHERE id = \''.$this->id.'\' '
CONDITION
是一个保留的mysql关键字 。 你必须用反引号括起来:
`condition`=\''.$this->condition.'\',
您必须重命名condition
列。 请参阅保留的MySQL关键字表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.