<tr>
<th>Quantité</th>
<th>Produit</th>
<th>Montant</th>
</tr>
<?php
$idmembre = $_SESSION['id'];
$sql = "select * from lignecommande, produit where lignecommande.idproduit=produit.idproduit and idmembre=$idmembre and etat='encours';";
$requete=mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($requete) > 0) {
while ($resultat = mysql_fetch_assoc($requete)){
echo"<tr>
<td>".$resultat['qte']."</td>
<td>".$resultat['designation']."</td>
<td>".$resultat['qte']*$resultat['prixkg']*$resultat['poids']."</td> //ici cela me renvoi le montant d'une ligne_commande, je dois l'arrondir avec la fonction round() mais cela me pose problème
</tr>";
}
}
else{
echo" Votre panier est vide";
}
?>
<tr>
<th>Total</th>
<td></td>
<td colspan=2>............</td>// ici je souhaiterais compter chaque montant de toute les lignes_commande retournées. Peut-être utiliser un compteur, mais je n'ai pas d'idee ..
</tr>
<tr>
<th>Quantité</th>
<th>Produit</th>
<th>Montant</th>
</tr>
<?php
$idmembre = $_SESSION['id'];
$sql = "select * from lignecommande, produit where lignecommande.idproduit=produit.idproduit and idmembre=$idmembre and etat='encours';";
$requete=mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($requete) > 0) {
while ($resultat = mysql_fetch_assoc($requete)){
echo"<tr>
<td>".$resultat['qte']."</td>
<td>".$resultat['designation']."</td>
<td>".$resultat['qte']*$resultat['prixkg']*$resultat['poids']."</td>
</tr>";
}
}
else{
echo" Votre panier est vide";
}
?>
<tr>
<th>Total</th>
<td></td>
<td colspan=2>.......</td>
</tr>
Quelqu'un peut il m'aider ?