大余安全2022百個(gè)項(xiàng)目滲透教學(xué)課程
? ? ? ?# insert_id_info = cursor.fetchall()
? ? ? ?
? ? ? ? ? ?# 獲取 ID 必須在 commit 之前,否則獲取為 0
? ? ? ? ? ?db.commit()
? ? ? ?except Exception as e:
? ? ? ? ? ?print(traceback.format_exc())
? ?cursor.close()
? ?db.close()
? ?return infoif __name__ == '__main__':
? ?insert_and_get_id()
標(biāo)簽: