ofc
This commit is contained in:
parent
d4d3213db1
commit
42ad01e493
@ -6,21 +6,21 @@ def add_row(compte, points, mycursor, mydb):
|
|||||||
val = (compte, points)
|
val = (compte, points)
|
||||||
mycursor.execute(sql, val)
|
mycursor.execute(sql, val)
|
||||||
mydb.commit()
|
mydb.commit()
|
||||||
printf(mycursor.rowcount, "record created.")
|
#printf(mycursor.rowcount, "record created.")
|
||||||
|
|
||||||
|
|
||||||
def update_row(compte, points, mycursor, mydb):
|
def update_row(compte, points, mycursor, mydb):
|
||||||
sql = f"UPDATE daily SET points = {points} WHERE compte = '{compte}' AND date = current_date() ;"
|
sql = f"UPDATE daily SET points = {points} WHERE compte = '{compte}' AND date = current_date() ;"
|
||||||
mycursor.execute(sql)
|
mycursor.execute(sql)
|
||||||
mydb.commit()
|
mydb.commit()
|
||||||
printf(mycursor.rowcount, "record(s) updated")
|
#printf(mycursor.rowcount, "record(s) updated")
|
||||||
|
|
||||||
|
|
||||||
def update_last(compte, points, mycursor, mydb):
|
def update_last(compte, points, mycursor, mydb):
|
||||||
sql = f"UPDATE comptes SET last_pts = {points} WHERE compte = '{compte}';"
|
sql = f"UPDATE comptes SET last_pts = {points} WHERE compte = '{compte}';"
|
||||||
mycursor.execute(sql)
|
mycursor.execute(sql)
|
||||||
mydb.commit()
|
mydb.commit()
|
||||||
printf(mycursor.rowcount, "record(s) updated")
|
#printf(mycursor.rowcount, "record(s) updated")
|
||||||
|
|
||||||
|
|
||||||
def get_row(compte, points, mycursor, same_points = True): #return if there is a line with the same ammount of point or with the same name as well as the same day
|
def get_row(compte, points, mycursor, same_points = True): #return if there is a line with the same ammount of point or with the same name as well as the same day
|
||||||
|
Loading…
Reference in New Issue
Block a user