Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 查询未通过mysql运行_Python_Mysql_Python 3.x_Flask_Mysql Python - Fatal编程技术网

Python 查询未通过mysql运行

Python 查询未通过mysql运行,python,mysql,python-3.x,flask,mysql-python,Python,Mysql,Python 3.x,Flask,Mysql Python,虽然存储在变量中的数据没有将值传递给select查询,但我无法从select查询中检索数据作为数据 from flaskext.mysql import MySQL @app.route("/loginscr/",methods =['POST']) def loginscr(): username = request.form['username'] password = request.form['password'] print(request.form.to

虽然存储在变量中的数据没有将值传递给select查询,但我无法从select查询中检索数据作为数据

from flaskext.mysql import MySQL

@app.route("/loginscr/",methods =['POST'])
def loginscr():

    username = request.form['username']
    password = request.form['password']

    print(request.form.to_dict())
    cursor = connection.cursor()
    cursor.execute('Select * from basics where username = %s AND password = %s',(username,password))
    account = cursor.fetchone()
    if account is not None:
        print("Successfull")
    else:
        print("UnSuccessfull")
    return "true"
fetchone()
不返回int.Replace

if(account == 1):

或者,更像蟒蛇

if account:
if account: