Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/02/2009, 14:17
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: problemas al multiplicar

Pues con un simple while:
Código php:
Ver original
  1. $multiplicaciones = array();
  2. while( $row = read_products() ) {
  3.         $multiplicaciones[] = $row['producto'] * $row['cantidad'];
  4. }
  5.  
  6. $total = array_sum($multiplicaciones);

Saludos