salut, voilà je fais un site de vente en ligne, et j'ai un petit probleme lors de la moddification de la quantité des produits. Je fais apparaitre des champs se trouvants dans un tableau dans une boucle, jusque là tout va bien.
Ensuite je voudrais pouvoir moddifier la quantité des produits, mais seulement le dernier de la liste est pris en compte.
Peux etre une mauvaise synthaxe? Pouvez vous m'aider svp??
<?php
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE tip SET ip=%s, `ref`=%s, quantite=%s WHERE idip=%s",
GetSQLValueString($_POST['ip'], "text"),
GetSQLValueString($_POST['ref'], "text"),
GetSQLValueString($_POST['quantite'], "text"),
GetSQLValueString($_POST['idip'], "int"));
mysql_select_db($database_whooppers, $whooppers);
$Result1 = mysql_query($updateSQL, $whooppers) or die(mysql_error());
}
?>
et voici le champ de résultats
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="contenu-texte">
<tr>
<td height="31"><strong>Référence</strong></td>
<td><strong>Titre</strong></td>
<td><strong>Qte</strong></td>
<td><strong>Prix unitaire</strong></td>
</tr>
<?php do { ?>
<form action="<?php echo $editFormAction; ?>" id="form2" name="form2" method="POST">
<tr>
<?php
$prix = $row_R_panier['prix'];
$quantite = $row_R_panier['quantite'];
;?>
<?php $ttc+=($prix*$quantite); ?>
<td width="18%"><?php echo $row_R_panier['ref']; ?></td>
<td width="44%"><?php echo $row_R_panier['titre']; ?>
</td>
<td width="9%">
<input name="quantite" type="text" id="quantite" value="<?php echo $row_R_panier['quantite']; ?>" size="3" />
<input name="idip" type="hidden" id="idip" value="<?php echo $row_R_panier['idip']; ?>" />
<input name="ip" type="hidden" id="ip" value="<?php echo $row_R_panier['ip']; ?>" />
<input name="ref" type="hidden" id="ref" value="<?php echo $row_R_panier['ref']; ?>" /></td>
<td width="29%"><?php echo $row_R_panier['prix']; ?> € </td>
</tr>
<?php } while ($row_R_panier = mysql_fetch_assoc($R_panier)); ?>
</table>
Je tourne en ronddddddddd
helppppppp VestaX
Merci d'avance