This tutorial will teach you how to get the Last Inserted id in python mysql. i will teach step by step.it will help you to make a inventory system. from tkinter import * from tkinter import messagebox import mysql.connector def Ok(): empname = e2.get() phone = e3.get() salary = e4.get() mysqldb=mysql.connector.connect(host="localhost",user="root",password="",database="payrollpy") mycursor=mysqldb.cursor() try: sql = "INSERT INTO records (id,empname,phone,salary) VALUES …