Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/04/2011, 15:30
Avatar de RIVERMILLOS
RIVERMILLOS
 
Fecha de Ingreso: marzo-2010
Mensajes: 1.336
Antigüedad: 14 años, 2 meses
Puntos: 15
Respuesta: Necesito crear una extencion?

Cita:
Iniciado por abimaelrc Ver Mensaje
Tal vez el problema sea la forma como los lees, ¿qué es lo que haces?
Mira esta es una funcion que procesa los resultados de una consulta..

Código PHP:

private function getDetails($idneigh,$ulti_posi,$contex){
$output=array();
$points_user=explode(' ',$ulti_posi);
$query="SELECT DXU.iddetallexusuarios,D.ruta,DXU.punto FROM detalle D
               INNER JOIN detallexusuarios DXU USING(iddetalle)
               WHERE DXU.idbarrio='"
.$idneigh."'";
  
$result=$this->conn->ejecutar($query);
    while(
$res=$this->conn->obtener_fila($result)){
     
$point_detail=explode(' ',$res->punto);
     if(
$this->getDistance($point_detail[0],$point_detail[1],$points_user[0],$points_user[1])){
     if(
$contex){
      if(!
in_array($res->iddetallexusuarios,$_SESSION['details'])){
      
$output[]=array('idproperty'=>$res->iddetallexusuarios,
                      
'url'=>'http://www.xxxxx.com.co/xx/xx/box.DAE',
                      
'point'=>$res->punto);
      }
      
$id_new_property[]=$res->iddetallexusuarios;
     }else{
      
$output[]=array('idproperty'=>$res->iddetallexusuarios,
                      
'url'=>'http://www.xxxxx.com.co/xx/xx/box.DAE',
                      
'point'=>$res->punto);
      
$_SESSION['details'][]=$res->iddetallexusuarios;
     }

     }
    }
if(
$contex){
if(isset(
$_SESSION['details']) && is_array($_SESSION['details'])){
 
$erase_details=array_diff($_SESSION['details'],$id_new_property);
 
$_SESSION['details']=$id_new_property;
  if(
$erase_details){
   
$count=count($erase_details);
   for(
$i=0;$i<$count;++$i){
    
$this->output->erase[]=$erase_details[$i];
   }
  }
}
}
return 
$output;

pero entonces son mucho datos, y la funcion se vuelve lenta porque son demaciadas iteraciones .

saludos