I am trying to do something with SQL for my school project. To use variables in the SQL statements I followed this post: How to use variables in SQL statement in Python?. But I am getting the following error in this function:
Something went wrong: Not all parameters were used in the SQL statement
def Einkauf():
Typ = int(input("Typ"))
Anzahl = input("Anzahl")
MHD = input("MHD (YYYYMMDD)")
try:
cursor.execute("insert into Warenlager(Anzahl, MHD, StatusID, TypId) values(?,?,1,?)", (Anzahl,MHD,Typ))
db.commit()
except mysql.connector.Error as err:
print("Something went wrong: {}".format(err))