我想向 mysql 发送一个查询并获取一个数组。但是无论我怎么做,我都无法让它发挥作用。这是我的代码:
@app.route('/auth',methods=['GET','POST'])
def auth():
username = request.form['username']
password = request.form['password']
cur = db.cursor()
cur.execute("SELECT * FROM tbl_user WHERE username = '%s' " % username)
results = cur.fetchall()
for row in results:
print row[0]
它总是说,view function did not return a response
。我究竟做错了什么?