Having error while store data to mysql database

An error occurred while saving data to MySQL databaser
Python type Entry cannot be converted

def save_to_database():
try:
sql = “INSERT INTO gate_pass (reference_number, employee_name, employee_code, date, created_by, laptop_tag, charger_tag, mouse_tag, laptop_serial_no, charger_serial_no, mouse_serial_no, Ass_Tag_2, Desc_2, S_No_2, Rem_2, Ass_Tag_3, Desc_3, S_No_3, Rem_3) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)”
val = (
generate_unique_number(),
name.get(),
Emp.get(),
datetime.strptime(Date.get(), “%m/%d/%y”).strftime(“%m-%d-%Y”),
Cre_By.get(),
Lap.get(),
Chr_Tag.get(),
Mou.get(),
Rem.get(),
Chr.get(),
Mou_Tag.get(),
get_value_or_na(Ass_Tag_2_entry),
get_value_or_na(Desc_2_entry),
get_value_or_na(S_No_2_entry),
get_value_or_na(Rem_2_entry),
get_value_or_na(Ass_Tag_3_entry),
get_value_or_na(Desc_3_entry),
get_value_or_na(S_No_3_entry),
get_value_or_na(Rem_3_entry)
)
mycursor.execute(sql, val)
mydb.commit()
messagebox.showinfo(“Success”, “Data saved successfully to MySQL database”)
except Exception as e:
messagebox.showerror(“Error”, f"An error occurred while saving data to MySQL database: {e}")

mydb = mysql.connector.connect(
host=“localhost”,
user=“root”,
password=“asd@123”,
database=“gatepass”
)
mycursor = mydb.cursor()

Please read the pinned thread and edit the post to show the code properly. You will have to redo the copy and paste, because the forum changes some parts of the code to make it “more readable” as ordinary text (but we want to read it as code instead). Please also ask us what you want to know, instead of just showing code and an error message. We need to understand the context for the problem, and specifically why it is a problem for you (what you need to know in order to solve it). We can’t see anything on your computer, so there’s no way we should know what any of these functions in your program do except for the part that you actually showed.