Saranno state le cozze, ma ho un problema che non riesco a risolvere.
Dovrei calcolare il totale "SPESA"
Posto solo la parte interessata:
Codice PHP:
while ($rw=mysql_fetch_array($rs))
{
echo "<td width=10% style=padding-left:10px>".$rw["id_prod"]."</td>";
echo "<td width=40% style=padding-left:10px>".$rw["prodotto"]."</td>";
echo "<td width=10% style=padding-left:10px>".$rw["pezzi"]."</td>";
echo "<td width=20% style=padding-left:10px>".$rw["prezzo"]."</td>";
$totale = number_format($rw["prezzo"] * $rw["pezzi"],2);
echo "<td width=20% style=padding-left:10px>";
echo $totale;
echo "€</td>";
echo "</tr>";
}
echo "</table>";
Ora la variabile $totale mi calcola il totale per quel articolo.
Ma per avere il TOTALE SPESA ????
con un foreach?