Python MySQL - SELECTs work but not DELETEs?

前端 未结 4 2035
难免孤独
难免孤独 2021-01-17 20:35

I\'m new to Python and Python\'s MySQL adapter. I\'m not sure if I\'m missing something obvious here:

db = MySQLdb.connect(# db details omitted)
cursor = se         


        
4条回答
  •  情歌与酒
    2021-01-17 21:29

    To your code above, just add a call to self.db.commit().

    The feature is far from an annoyance:

    It saves you from data corruption issues when there are errors in your queries.

提交回复
热议问题