Jun-12-2020, 02:59 AM
(This post was last modified: Jun-12-2020, 03:13 AM by card51shor.)
@app.route("/login", methods=["GET","POST"]) def login(): password = request.form.get("password") username = request.form.get("username") usernamedata = db.execute("SELECT username FROM users WHERE username=:username", {"username":username}).fetchone() passworddata = db.execute("SELECT password FROM users WHERE username=:username", {"username":username}).fetchone() username1 = usernamedata[0]; password1 = passworddata[0]; print(username1) print(password1) print(username) print(password) if username == usernamedata and password == passworddata: return render_template("login.html") else: return render_template("login.html")I'm a genius and I figured it out!
never mind - now it doesn't work for some reason.
for some reason now i can't do usernamedata[0] since it's only one result i assume - but it did let me do it at first.
why is fetchone() returning all the extra junk characters!?