python에서 SQL Update가 적용이 되지 않을 때
python에서 MySQL등에 Cursor를 통해서 Update/Insert를 할 때 결과는 True가 리턴되지만, 값이 적용되지 않는 경우가 있는데,
이경우는 Connection에 autocommit을 True로 하거나 Excute뒤에 commit을 적어준다.
con = MySQLdb.connect(host=’localhost’, user=’doe’ passwd=’doe’ db=’mysql’)
con.autocommit(True)
하거나
cs = con.cursor()
cs.execute(“update temp set ~~”)
cs.execute(“commit”)
