error code for importing python data into mysql not all parameters were used in the sql statement

It seems that your data1 is not a list of dictionaries, but dictionary with ‘cashier’ key and list of dictionaries as value. You can call executemany function this way:

mycursor.executemany(insert_query, data1['cashier']) 

or if your data1 store values for different cashiers and you assign to cashier variable a specified value, you can use executemany function this way:

cashier = input("cashier name: ")
mycursor.executemany(insert_query, data1[cashier]) 

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top