$resultado = $modelSga->getConsultaSga($ano, $mes, $unidade);
foreach ($resultado as $res) {
$idServico = $res->id_serv;
$servico = array();
if($idServico != $idServicoAnterior) {
array_push($servico, $res->nm_serv);
echo($servico[0]);
}
echo "<br/>";
}
What I am trying to do is for every ID_SERV
different it will get the nm_serv
and store it in a grouping array . This will be useful since I will create a table for each different information. ex:
SECTOR
car
car
car
car
SECTOR
motorcycle
motorcycle
motorcycle
motorcycle
SECTOR
....
....
....