realizando la consulta a la base de datos postgresql obtengo el siguiente array
Cita:
array(6) { [0]=> object(stdClass)#283 (2) { ["a"]=> string(4) "2013" ["id"]=> int(5) } [1]=> object(stdClass)#284 (2) { ["a"]=> string(4) "2014" ["id"]=> int(1) } [2]=> object(stdClass)#285 (2) { ["a"]=> string(4) "2014" ["id"]=> int(2) } [3]=> object(stdClass)#286 (2) { ["a"]=> string(4) "2014" ["id"]=> int(3) } [4]=> object(stdClass)#287 (2) { ["a"]=> string(4) "2014" ["id"]=> int(4) } [5]=> object(stdClass)#288 (2) { ["a"]=> string(4) "2014" ["id"]=> int(9) } }
2013
2014
2014
2014
2014
2014
hasta el momento tengo lo siguiente
Código PHP:
Ver original
foreach ($years as $key => $year){ <table class="table table-striped table-bordered"> <thead> <tr> <th colspan="10"><p class="text-center"><?php echo $year->a ?></p></th> </tr> </thead> <tbody> <tr> <td></td> </tr> </tbody> </table> }
me encuentro confundido en la parte del ciclo para que compare y continue. es posible con foreach?