Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/08/2013, 06:12
Avatar de Triby
Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Devolver varios valores

Tu planteamiento es incorrecto, supongo que hiciste alguna edición a tu código para pegarlo aquí. Debe ser más o menos así:

Código PHP:
Ver original
  1. function getNoticias() {
  2.       // Inicializas $noticias
  3.       $noticias = array();
  4.       $query = $this->consulta('aquí tu consulta');
  5.       while($array = $this->fetch_assoc($query)) {
  6.             $noticias[] = $array;
  7.       }
  8.       return $noticias;
  9. }

De esta forma siempre devuelves un array y basta con count($variable) para saber cuantos registros obtuviste.
__________________
- León, Guanajuato
- GV-Foto