Answer the question
In order to leave comments, you need to log in
Fetch data from database using flask-mysql?
Good afternoon, I need to get the value from the column name
and save it to a variable, it seems that I was on the right path, but then something went wrong, the
code:
conn = db.connect()
cur = conn.cursor()
status = ''
cur.execute('''SELECT id FROM user WHERE name=%s''', (str(status)))
return render_template('pages/admin.html', title = 'Admin Panel', status=status)
Answer the question
In order to leave comments, you need to log in
Firstly, you missed the comma - (str(status),)
Secondly, you do not use the result of the selection in any way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question