Im trying to do a system, login and register with database sqlite in Python. The register system is working, but the problem is the login part, when i insert login and password, always say Login failed
My code:
con = sqlite3.connect("dados.db")
cur = con.cursor()
passw = log.passw.text()
user = log.user.text()
passcrypt = hashlib.sha256(passw.encode("utf-8")).hexdigest()
cur.execute('SELECT user,senha FROM contas WHERE user=? AND senha=?', (user,passcrypt))
if cur.fetchall():
print("Logged")
else:
print("Login failed")
How can i fix this? Always say Login failed.
source https://stackoverflow.com/questions/70406811/login-system-with-sqlite-in-python
Comments
Post a Comment