i solved the subtotal of each item problem with this:
(not so far from what you told me😃 )
function listaCarrinho($login_utilizador) {
$sql = "SELECT * FROM carrinho WHERE email='$login_utilizador' ORDER BY id";
$rs=$this->bd->executarSQL($sql);
echo "<tr bgcolor=\"#FFFFFF\">";
$n=0;
while(mysql_fetch_row($rs)) {
$subtotal = mysql_result($rs, $n, "preco") * mysql_result($rs, $n, "qte");
echo "<td bgcolor=\"#FFFFFF\"><a href=\"index.php?pagina=alterar
&id=".mysql_result($rs, $n, "id")."&tipo=".mysql_result($rs, $n, "tipo")."
&modelo=".mysql_result($rs, $n, "modelo")."&cod=".mysql_result($rs, $n, "cod")."
&preco=".mysql_result($rs, $n, "preco")."&qte=".mysql_result($rs, $n, "qte")."\">
<img src=\"imagens/seta.gif\" border=\"0\" width=\"12\" height=\"10\"></td>
<td bgcolor=\"#FFFFFF\">".mysql_result($rs, $n, "qte")."</b>
<td bgcolor=\"#FFFFFF\">".mysql_result($rs, $n, "cod")."</b></td>
<td bgcolor=\"#FFFFFF\">".mysql_result($rs, $n, "tipo")."</td>
<td bgcolor=\"#FFFFFF\">".mysql_result($rs, $n, "modelo")."</td>
<td bgcolor=\"#FFFFFF\" align=\"center\">$subtotal €</td>";
echo "</tr>";
$n++;
}
echo "</table>";
}
now this is more complicated i think.
i need a row in the end of the table that shows the sum os all the subtotals.
any thoughts?!