%d format a number is required not str
问题 I have a table named tablename with idno as primary kry. I want the row to be deleted if the user specifies the idno in the table. Here are my codes: data3=raw_input("Enter the idno to del :",) mydata=cursor.execute("DELETE FROM tablename where idno=%d", data3) db.commit() I'm getting this error: Traceback (most recent call last): File "C:\Python27\trertr.py", line 50, in mydata=cursor.execute("DELETE FROM tablename where idno=%d", data3) File "C:\Python27\lib\site-packages\MySQLdb\cursors.py