I assumed that it is possible to create a variable (us_id) initially it is equal to 0, then it is assigned the value of the user id, the id is written to the database and each row is 0. later, I pick out these values and assign them to variables d1, d2, d3. the problem is that in order for the bot to work, you need to manually enter the id (where user_id is)
cursor.execute("SELECT Delete1 FROM test2 WHERE user_id=us_id")
Delete1 = cursor.fetchall()
cursor.execute("SELECT Delete2 FROM test2 WHERE user_id=us_id")
Delete2 = cursor.fetchall()
cursor.execute("SELECT Delete3 FROM test2 WHERE user_id=us_id")
Delete3 = cursor.fetchall()
if d1 == 1:
with conn:
cursor.execute("UPDATE test2 SET Delete1 = 1 WHERE user_id=us_id;")
if d2 == 1:
with conn:
cursor.execute("UPDATE test2 SET Delete2 = 1 WHERE user_id=us_id;")
if d3 == 1:
with conn:
cursor.execute("UPDATE test2 SET Delete3 = 1 WHERE user_id=us_id;")