【发布时间】:2012-11-23 00:49:20
【问题描述】:
我正在尝试通过带有 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")
谢谢
【问题讨论】:
标签: python python-2.7 web.py