我正在尝试使用html页面在网页中显示查询结果。我只能显示列中的第一行,但我需要显示所有行行。请建议:
def formval():
# --connection syntax here--
cursor = connection.cursor()
if request.method == 'POST':
x = request.form['weekno']
cursor.execute("SELECT Document FROM Backlog where custno=?",x)
result = cursor.fetchall()
return render_template('home.html',weekno=result)
home.html
{% for docno in weekno %}
<p>{{ docno }}</p>
{% endfor %}
上面是我在html页面中用来捕获数据库结果的一段代码。你知道吗
谢谢!你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐