Foros del Web » Programando para Internet » PHP » Frameworks y PHP orientado a objetos »

Como leer este Array = ARAY($ROW[0], $ROW[1], $ROW[2])

Estas en el tema de Como leer este Array = ARAY($ROW[0], $ROW[1], $ROW[2]) en el foro de Frameworks y PHP orientado a objetos en Foros del Web. hola, me estoy iniciando en esto de la POO en PHP y tengo este codigo function trae_todos() { $retorno = array(); $this->query->sql = "SELECT "; ...
  #1 (permalink)  
Antiguo 09/06/2008, 18:11
 
Fecha de Ingreso: junio-2008
Mensajes: 53
Antigüedad: 15 años, 10 meses
Puntos: 1
Como leer este Array = ARAY($ROW[0], $ROW[1], $ROW[2])

hola, me estoy iniciando en esto de la POO en PHP

y tengo este codigo

function trae_todos() {
$retorno = array();
$this->query->sql = "SELECT ";
$this->query->sql .= "ID_COMP, NOMBRE_COMP, DESCRIP_COMP ";
$this->query->sql .= "FROM COMPETENCIAS";
$this->query->ejecuta_sql();

while( $row = $this->query->fetch_array() ) {
$retorno[] = array($row[0], $row[1], $row[2]);
}

return $retorno;
}

necesito saber como mostrar el contenido del array $retorno

el codigo de $this->query->fetch_array() es el siguiente, haber si aclara algo mas el tema

function fetch_array() {
$row = array();

if( $this->fbool ) {
//return oci_fetch_array($this->fcursor);
OCIFetchInto($this->fcursor, $row);
};
return $row;
}

ayuda por favor....
  #2 (permalink)  
Antiguo 09/06/2008, 21:27
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Como leer este Array = ARAY($ROW[0], $ROW[1], $ROW[2])

Hola hzapata9,

El array ya te regresa todas las filas, lo que deberias de hacer es solamente donde lees la instancia de tu objeto accesar a la propiedad, por ejemplo:
Código PHP:
$arreglo $instancia->trae_todos();
var_dump$arreglo ); 
Saludos.
  #3 (permalink)  
Antiguo 10/06/2008, 14:54
 
Fecha de Ingreso: junio-2008
Mensajes: 53
Antigüedad: 15 años, 10 meses
Puntos: 1
Respuesta: Como leer este Array = ARAY($ROW[0], $ROW[1], $ROW[2])

OOOHH..... gracias por la respuesta GatorV..... todo bien ahora :)

podrías explciarme poruqe al hacer esto no conseguia nada:

var_dump( $retorno );
  #4 (permalink)  
Antiguo 10/06/2008, 17:04
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Como leer este Array = ARAY($ROW[0], $ROW[1], $ROW[2])

Habría que ver bajo que contexto estas usando ese var_dump.

Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:57.