Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/03/2010, 14:18
Avatar de wladtepes
wladtepes
 
Fecha de Ingreso: febrero-2008
Mensajes: 140
Antigüedad: 16 años, 3 meses
Puntos: 0
Exclamación Calcular datos sql -php

HOLA ESTOY TRATANDO DE HACER UN CICLO EN PHP CON EL CUAL EXTRAER DATOS DE MYSQL Y HACER UNOS CALCULOS Y DE ESE RESULTADO CONTAR CUANTOS DON DE UN TIPO Y CUANTOS SON DE OTRO

TENGO EL CLICLO CREADO Y LA FORMULA PARA EL CALCULO PERO NO LOGRO SACAR LOS DATOS QUE SON DE UN TIPO Y SUMARLOS


Código PHP:


$regiones2 
=mysql_query("select *  from TABLA where DATO ='XXX' ");
    
$numero_filas=mysql_num_rows($regiones2);

     if(
$row1 mysql_fetch_array($regiones2))
     {
     do{
     
      
$creacion=$row1["DATO_UNO"];
      
$cierre=$row1["DATO _DOS"];
      
$total=($cierre-$creacion);
      
      echo 
$total."<br> ";
      
          
$uno=($total);
      if(
$uno200)
      {
      echo 
" no cumple";
//aca me gustaria hacer los contadores  para la cantidad de datos que no cumplen
      
      
}
      else
      {
echo 
"cumple";

//aca me gustaria hacer los contadores para la cantidad de datos que cumplen
       

          while (
$row1 mysql_fetch_array($regiones2));

      
       } 


de antemano gracias