Ver Mensaje Individual
  #9 (permalink)  
Antiguo 15/05/2011, 20:04
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 4 meses
Puntos: 845
Respuesta: Mostrar Objeto Array

A ver proba sin $i, algo así:

Código PHP:
Ver original
  1. public function Listar()
  2. {  
  3.     $db = new Conectar();
  4.     $consulta = $db->consulta(" SELECT * FROM ciudad ");
  5.    
  6.     $lista = array();
  7.    
  8.     if($db->num_rows($consulta) > 0) {    
  9.         while($resultado = $db->fetch_array($consulta)) {
  10.             $lista[] = new ciudad($resultado['id_ciudad'], $resultado['nombre_ciudad']);            
  11.         }
  12.     }
  13.     print_r($lista);
  14.     return $lista;  
  15. }

y podes postear el constructor de ciudad ?
__________________
http://es.phptherightway.com/
thats us riders :)