I am trying to do a simple update in python. This the code I try to run:
mycursor = mydb.cursor()
if(result<5):
os.remove(destiny)
print(result)
print(fi[:-4])
print(lastid)
sql = "UPDATE googlesearch SET similarity=%s WHERE tweetid=%d and imageName=%s"
value = (str(result),lastid,str(fi[:-4]))
print(value)
mycursor.execute(sql, value)
mydb.commit()
As you can see it is very easy. But when I run it, I have this error:
ProgrammingError: Not all parameters were used in the SQL statement
Printing values, I have this: ('2.82258064516129', 2636, 'dimg_10') And working in Navicat with this sentence, everything is perfect. So why, I have this error?.
%s, not%d.