Ver Mensaje Individual
  #8 (permalink)  
Antiguo 29/01/2009, 13:18
Fenris
 
Fecha de Ingreso: agosto-2008
Mensajes: 271
Antigüedad: 15 años, 8 meses
Puntos: 2
Respuesta: Obtener variables de una funcion

Código:
        public function ObtenerValores() {
        
            $ejecuto=$this->db->ejecutarQuery($this->Query);
            while($row=mysql_fetch_array($ejecuto)){        

            $this->Nombre=$row['Nombre'];
                        $this->Apellido=$row['Apellido'];           
 
          }
Dentro de esta funcion podrias utilizar un arreglo y la instruccion return para no sobreescribir la variable en cada vuelta del ciclo, con lo que quedaria asi.

Código:
        public function ObtenerValores() {
        
            $ejecuto=$this->db->ejecutarQuery($this->Query);

            while($row=mysql_fetch_assoc($ejecuto)){        

            $this->recordset[]=$row;
            }
   return $this->recordset;

          }
Luego solo seria leer ese arreglo con un ciclo iterativo.