Skip to content
Snippets Groups Projects
Commit 465360b1 authored by Adrien Chabod's avatar Adrien Chabod
Browse files

Liste de tuple

parent 984595e6
No related branches found
No related tags found
1 merge request!1MAJ BDD + Data commande fonctionnel
......@@ -91,11 +91,12 @@ def mysql_maj_machine(maj: tuple):
connection.close()
def mysql_get_composition_for_machine(commande: tuple):
data = []
connection = connect_db()
cursor = connection.cursor()
for k in commande:
cursor.execute("SELECT machine.id_bec, quantite FROM ingredient INNER JOIN machine ON ingredient.id_bec = machine.id_bec WHERE ingredient.id_ingredient = %s", (k[1],))
data = data + cursor.fetchall()
data.append(cursor.fetchall())
cursor.close()
connection.close()
return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment