Ver Mensaje Individual
  #6 (permalink)  
Antiguo 28/05/2016, 11:20
maurikius1983
Usuario no validado
 
Fecha de Ingreso: abril-2012
Mensajes: 134
Antigüedad: 12 años, 1 mes
Puntos: 0
Respuesta: Aplicando DAO a php

Algo así podría ser??

Código:
public function showAllNotice() {

        $mysqli = $this->connect();
        $result = $mysqli->query("SELECT * FROM notice");
        $arrayNotice = [];
        while ($row = $result->fetch_assoc()) {

            $notice = new Notice();
            $notice->setNoticeId($row['notice_id']);
            $notice->setNoticeTitle($row['notice_title']);
            $notice->setNoticeDate($row['notice_datetime']);
            $notice->setNoticeContent($row['notice_content']);
            $arrayNotice[] = $notice;
        }

        return $arrayNotice;
    }
Y ya solo quedaria recorrer el array de objetos y recuperar los valores con los get, ¿no?