cursor = conn.cursor()
updateRecordStatus = "UPDATE queue SET status = " + str(status) + " WHERE qid = " + str(qid) + ";"
cursor.execute(updateRecordStatus)
conn.commit()
cursor.close ()
The tricky part of troubleshooting this was that cursor.rowcount and cursor.statusmessage were returning '1' and 'UPDATE 1' respectively, yet the row was not changing in the table.
Thanks to this example for helping me out:
http://www.daniweb.com/forums/post962021.html#post962021
3 comments:
Thanks man! that was driving me nuts!!!
The conn.commit() part is really important!
The example you 've red gives bad examples, don't concat strings, read the doc of cursor.execute()
Post a Comment