I've searched around but it looks like most people with a similar question have two strings on one SQL variable, whereas I have two different arguments.
My code:
xpcounter = ("UPDATE CharactersDB SET Exp=%s WHERE %s", xp, name) #where is name variable
cur.execute(*xpcounter)
I have also tried:
xpcounter = ("UPDATE CharactersDB SET Exp=%s WHERE %s") #where is name variable
cur.execute(xpcounter, xp, name)
both times I get a
TypeError: execute() takes at most 3 arguments (4 given)
What am I doing wrong?
Thanks!
EDIT: As per monoid's suggestion, my code now looks like:
xpcounter = ("UPDATE CharactersDB SET Exp=%s WHERE %s", (xp, name,)) cur.execute(*xpcounter)
Now I get a
Truncated incorrect INTEGER value: 'testname'
when I run it.
EDIT: Turns out my database is updating correctly, just a warning, not an error.