title: SET working every other time Python MySQL
body: <p>Im trying to set a value in my table with a given ID. When I run this code I am getting a return code of 1 on 'cursor.execute(updateStr)' the first time I run it, but it executes without issue and returns 0 when I run it a second time. There is no exception raised and I am not sure how to retrieve the actual error message. What could cause this problem and how do I dig deeper into the actual error? Thanks for looking.</p>
  
  <pre><code>updateStr = "UPDATE db.table SET OverrideVal = '{0}' WHERE table.OverrideID ={1};".format(overrideVal, overrideID)
  
  returnCode = cursor.execute(updateStr)
  
  if returnCode == 0:
      cursor.execute("COMMIT")
  else:
      cursor.execute("ROLLBACK")
  </code></pre>