Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/03/2008, 04:22
lugointernet
 
Fecha de Ingreso: agosto-2004
Ubicación: Lugo
Mensajes: 15
Antigüedad: 19 años, 8 meses
Puntos: 0
Re: realizar facturacion dia/mes/año desde tabla SQL

Código PHP:
<?php mysql_select_db($bd,$cnn); 
            
$sSQL="SELECT importe FROM alquileres WHERE fdevolucion='".date('Y-m-d')."'"
            
$res=mysql_query($sSQL,$cnn) or die (mysql_error()); 
            for (
$cnt=0;$cnt<mysql_num_rows($res);$cnt++){ 
            
$row=mysql_fetch_assoc($res); 
            
$row['fdevolucion']; 
            
$row['importe']; 
$importe $importe $row['importe'];
            

            
/*while ($row['fdevolucion']='".date("Y-m-d")."') { 
            $resultado=0; 
            foreach ($row['importe'] as $valor){ 
                $resultado=$resultado+$valor; 
            } 
            echo $resultado . "€"; 
            }
            while ($row['fdevolucion']='".date('Y-m-d')."') { 

            } */ 
            //echo $row['importe'] . "<BR>"; 
            
}

echo 
$importe;
?>
No entiendo como estas utilizando la funcion array_sum

La funcion array_sum se utiliza asi
Código PHP:
$importe = array(1234);
echo 
array_sum($importe);