如果我删除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.'\' '
Run Code Online (Sandbox Code Playgroud)
CONDITION是一个保留的mysql关键字.你必须用反引号括起来:
`condition`=\''.$this->condition.'\',
Run Code Online (Sandbox Code Playgroud)