with conn.cursor() as cursor:
sql="select * from database where user_name='"+username+"'and password='"+password+"';"
cursor.execute(sql)
user=cursor.fetchone()
if len(user)>=1:
return redirect(url_for('lobby',user=user))
@app.route('/lobby/<user>')
def lobby(user):
return render_template('lobby.html',user=user)
link แสดงข้อมูลด้วย
image_2022-11-24_114438378.png (13.92 KiB) Viewed 694 times
with conn.cursor() as cursor:
sql="select * from tool_checkers_user where user_name='"+username+"'and password='"+password+"';"
cursor.execute(sql)
user=cursor.fetchone()
print(user[0])
print(" ".join(str(row) for row in user))
session['user']=user
if len(user)>=1:
return redirect(url_for('lobby'))
@app.route('/lobby')
def lobby():
user=session.get('user')
return render_template('lobby.html',user=user)