i have a function that needs to update all rows to 0 after all rows have 1..
I have made some save systhem it needs to work like this. I got multiple employee, after i use a button 2 mails will be send. After the mail send savecounter will update to 1 and if i close the program then he knows where tho start again.
my question now is, how do i make a query that checks if all savecounter rows is 1. and if so update it all to 0. what do i need to do thanxx
def savecountercheck():
conn = sqlite3.connect('schoonschip.db')
cursorr = conn.cursor()
employe = cursorr.execute('SELECT savecounter FROM employee ')
selection = cursorr.fetchall()
for i in selection:
if i == 1:
cursorr.execute('UPDATE employee SET savecounter = 0 ' )
conn.commit()
conn.close()
print(selection)