i am creating a simple crud application in python.i ran into the problem with couln't delete records.what i tried so far i attached below i don't know what was a problem. i got the error on the console 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%s'
def delete():
studid = e1.get()
mysqldb=mysql.connector.connect(host="localhost",user="root",password="",database="smschool")
mycursor=mysqldb.cursor()
try:
sql = "delete from record where id = %s"
val = (studid)
mycursor.execute(sql, val)
mysqldb.commit()
lastid = mycursor.lastrowid
messagebox.showinfo("information", "Record Deleteeeee successfully...")
e1.delete(0, END)
e2.delete(0, END)
e3.delete(0, END)
e4.delete(0, END)
e1.focus_set()
except Exception as e:
print(e)
mysqldb.rollback()
mysqldb.close()