I'm trying to update two rows in SQLite with Python:
Puntero.execute(
"UPDATE '{T}' set '{F}' = '{C}','{V}' = '{U}' where ID='{I}'"
.format(T = Tabl, F = fecha, V = Vendidos, U = id, C= Cantidad, I=id))
Thanks for helping!
First, don't do it that way. You are setting yourself up for SQL injections. Use placeholders instead.
What you want is:
Puntero.execute(
"UPDATE Tabl set fecha = :C, Vendidos = :U where ID=in(:I1, :I2)",
{"U": id, "C":Cantidad, "I1":id, "I2":otherid}
)
"... where ID='{I}' OR ID='{I_other}'".format(... I=id, I_other=id_other)