Answer the question
In order to leave comments, you need to log in
How to pass the name of the table through a character?
Hello, there is such a function:
def check_user_bd(user_id, table):
cursor.execute('SELECT * FROM (?) WHERE user_id=(?)', (table, str(user_id)))
if not cursor.fetchall():
return False
else:
return True
Answer the question
In order to leave comments, you need to log in
c.execute("UPDATE data SET pass = ? WHERE name = ?", (password, login))
Just ?, without () try
cursor.execute("SELECT * FROM '{}' WHERE user_id='{}' ".format(table, str(user_id)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question