To_DO: ERROR AFTER LOGGING IN

This commit is contained in:
florianuhlig
2025-10-03 15:03:18 +02:00
parent 70c85cb8be
commit 1554723ed4
27 changed files with 1484 additions and 273 deletions

40
OLD/sqlLite/get.py Normal file
View File

@@ -0,0 +1,40 @@
import sqlite3
from . import db_name
def get_all_users():
conn = sqlite3.connect(db_name)
cursor = conn.cursor()
cursor.execute('select * from T_USERS')
rows = cursor.fetchall()
for row in rows:
print(row)
def get_userinfo_by_username(username):
conn = sqlite3.connect(db_name)
cursor = conn.cursor()
cursor.execute('select * from T_USERS where username = ?', (username,))
rows = cursor.fetchall()
for row in rows:
print(row)
def get_password_by_username(username):
conn = sqlite3.connect(db_name)
cursor = conn.cursor()
cursor.execute('SELECT PASSWORD FROM T_USERS WHERE username = ?', (username,))
row = cursor.fetchone()
cursor.close()
conn.close()
if row is None:
return None
return row[0] # password string
def get_password_by_email(email):
conn = sqlite3.connect(db_name)
cursor = conn.cursor()
cursor.execute('SELECT PASSWORD FROM T_USERS WHERE EMAIL = ?', (email,))
row = cursor.fetchone()
cursor.close()
conn.close()
if row is None:
return None
return row[0] # password string