I'm using mysql with python, I got an error when using a bind varialbe. Actually I don't know how to use a bind variable. Please help me with my problem.
Here is my code:
iouNo=textiv1.get()
cursor.execute("UPDATE iou_table SET IOU_status=4 WHERE IOU_No= :iouNo",{'iouNo':iouNo})
mydb.commit()
This is the error I got
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':'iouNo'' at line 1
I want to use the iouNo variable inside the SQL query... How can I do it?