2
 $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’m trying to do is for every ID_SERV different he’ll take the nm_serv and store in a array grouping. This will be useful as I will create a table for each different information. ex:
SECTOR 
car
car
car
car
SECTOR 
motorcycle 
motorcycle 
motorcycle 
motorcycle 
SECTOR 
.... 
.... 
.... 

I don’t understand. Can you describe it a little better? Especially in the title that doesn’t say what your problem is.
– Maniero
Can you clarify better what you want? do not understand bulbs...
– gmsantos
So, I will assemble a table of 5 columns only that the information will be divided, IE, each id_serv (which is also nm_serv) will turn a table, type image I posted.
– phpricardo
id_serv is what I believe I will use to divide the tables.
– phpricardo