【发布时间】:2016-12-08 09:42:02
【问题描述】:
elif request.method == "POST":
post = request.form.get("question")
option_1 = request.form.get("option1rename")
option_2 = request.form.get("option2rename")
db.execute("INSERT INTO posts (question, option1, option2) VALUES(:post,
option1, :option2)", post=post, option1=option_1, option2 = option_2)
new_post = db.execute("SELECT id FROM posts WHERE question = :post",
post=post)
print(new_post)
没有任何表单响应被添加到数据库中。我不能为
我的生活找出原因。有人可以帮忙吗?
【问题讨论】:
-
这是烧瓶吗?如果是这样,您需要添加flask标签
-
你需要提交你的交易:)
-
什么意思?
-
AttributeError: 'SQL' 对象没有属性 'commit'
-
您忘记了
option1参数之前的:。
标签: python html sql database flask