我的代码显示了不正确的 mysql 语法,尽管它是正确的

My code is showing incorrect mysql syntax although it is correct

scholar_no = int(input('Enter the Scholar Number'))

mycursor.execute("delete from student1 WHERE Scholar_No = %s", (scholar_no))
mydb1.commit()

你必须添加元组而不是单个变量,即使它只是一个值

mycursor.execute("delete from student1 WHERE Scholar_No = %s", (scholar_no,))