I keep gettin this error with my SQL :
Error reading data from MySQL table 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
My SQL is correct, it works in the console but not in python file. I think the error is in params, because the code seems working and just after params, my print("done") doesn't print :) But I can't see it :/
this is my code ( btw I use the global variable g for my database and it works in my other functions) :
cursor = g.connection.cursor(dictionary=True)
requete = f""" insert into classicmodels.customers
( customerNumber,
customerName,
contactLastName,
contactFirstName,
phone,
addressLine1,
addressLine2,
city,
state,
postalCode,
country
) VALUES (%s,%s,%s, %s, %s , %s, %s, %s, %s, %s, %s)
"""
nouveau_id = self.obtenir_dernierCustomerNumber()["customerNumber"]
params = (nouveau_id, formulaire.form['nom'] + formulaire.form['prenom'],
formulaire.form['nom'], formulaire.form['prenom'],
formulaire.form['phone'], formulaire.form['adresseA'], formulaire.form['adresseB'],
formulaire.form['ville'], formulaire.form['etat'],
formulaire.form['codePostal'], formulaire.form['country'],)
print(params)
cursor.execute(requete, params)
g.connection.commit()