PHP-Mysql boucle FOR
volumeni
-
volumeni -
volumeni -
Bonjour,
j'ai un $ingredient1, un $ingredient2 et un $ingredient3
chacun a respectivement une $quantite1 $quantite2 et $quantite3
j'aimerais faire
mais avec un FOR parce que j'ai un peu + que 3 ingrédients
comment faire ? merci
j'ai un $ingredient1, un $ingredient2 et un $ingredient3
chacun a respectivement une $quantite1 $quantite2 et $quantite3
j'aimerais faire
mysql_query("UPDATE `inventaire` SET `quantite` = '".$quantite1."' WHERE `nom_objet` ='".$ingredient1."';")or die ("erreur update quantites ingreds :".mysql_error());
mais avec un FOR parce que j'ai un peu + que 3 ingrédients
comment faire ? merci
A voir également:
- PHP-Mysql boucle FOR
- Downloader for pc - Télécharger - Téléchargement & Transfert
- Easy php - Télécharger - Divers Web & Internet
- Mysql community server - Télécharger - Bases de données
- Idm for mac - Télécharger - Téléchargement & Transfert
- Copytrans heic for windows - Télécharger - Visionnage & Diaporama
1 réponse
en fait je viens de trouver
il suffit de remplacer les variables sous la forme
$ingredient[1] et non pas $ingredient1
apres on peut écrire
il suffit de remplacer les variables sous la forme
$ingredient[1] et non pas $ingredient1
apres on peut écrire
for($i=0; $i<3 ;$i++){ mysql_query("UPDATE `handkrafting_inventaire` SET `quantite` = '".$ingred_reste[$i]."' WHERE `nom_objet` ='".$ingredient[$i]."';")or die ("erreur update quantites ingreds :".mysql_error()); }