![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
20/04/2011, 13:07
|
| | Fecha de Ingreso: abril-2011
Mensajes: 2
Antigüedad: 13 años, 9 meses Puntos: 0 | |
Respuesta: Varios productos en cesta de la compra tengo este codigo para mostrar los datos que voy agregando, como hago para que esos datos se almacenen en la BD
$i = 1;
$total = 0;
foreach($carrito as $producto)
{
echo("<tr>\n");
echo("<td width=\"9%\">" . $i++ . "</td>\n");
echo("<td width=\"50%\">" . $producto[0] . "</td>\n");
echo("<td width=\"10%\">" . $producto[1] . "</td>\n");
echo("<td width=\"7%\">" . $producto[2] . "</td>\n");
echo("<td width=\"6%\">" . $producto[3] . "</td>\n");
echo("<td width=\"8%\">" . $producto[4] . "</td>\n");
echo("</tr>\n");
$total += $producto[4];
}
echo("<tr>\n");
echo("<td width=\"9%\"> </td>\n");
echo("<td width=\"50%\"> </td>\n");
echo("<td width=\"10%\"> </td>\n");
echo("<td width=\"7%\"> </td>\n");
echo("<td width=\"6%\">Total</td>\n");
echo("<td width=\"8%\">" . $total . "</td>\n");
echo("</tr>\n"); |