夏c++11 14 17 29 多線程從原理到線程池實戰(zhàn)
2022-11-29 23:35 作者:OoAmandaOoo | 我要投稿
? # # 方法二
? ? ? ? ? ?# cursor.execute("select last_insert_id();")
? ? ? ? ? ?# insert_id_info = cursor.fetchall()
? ? ? ?
? ? ? ? ? ?# 獲取 ID 必須在 commit 之前,否則獲取為 0
? ? ? ? ? ?db.commit()
? ? ? ?except Exception as e:
? ? ? ? ? ?print(traceback.format_exc())
? ?cursor.close()
? ?db.close()
? ?return info
標(biāo)簽: