Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
conn = sqlite3.connect("users.db")
cursor = conn.cursor()
query = f"""SELECT * from questionnaires WHERE user_id={user_id}"""
cursor.execute(query)
check = cursor.fetchall()
if check:
#если пользователь есть
else:
#если нету
connect = sqlite3.connect("users.db")
cursor = connect.cursor()
cursor.execute("SELECT userid FROM users WHERE postid=?",(user_id,))
check = cursor.fetchall()
if check:
#если пользователь с таким id есть
else:
#если нету
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question