我正在尝试通过带有 web.py 的表单 POST 更新数据库行,但出现 MySQL 语法错误。我一般是 Python 新手,所以请原谅我的新手问题。这是我正在运行的代码:
def Update(webInput):
db.update('category', where='category_name=' + webInput.category_name)
return;
我得到的错误是
ProgrammingError: (1064, "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 category_name=' at line 1")
谢谢