I have my functional sql query. If I print it with print_r
it gives me all the information I need, which are only 5 records with 3 data:
Array ( [0] => stdClass Object ( [fecha_del_deposito] => 2018-05-08 [importe] => 60 [tipo_de_pago] => Mensualidad ) [1] => stdClass Object ( [fecha_del_deposito] => 2018-05-08 [importe] => 300 [tipo_de_pago] => Mensualidad ) [2] => stdClass Object ( [fecha_del_deposito] => 2018-05-08 [importe] => 360 [tipo_de_pago] => Mensualidad ) [3] => stdClass Object ( [fecha_del_deposito] => 2018-05-08 [importe] => 929 [tipo_de_pago] => Credito ) [4] => stdClass Object ( [fecha_del_deposito] => 2018-05-08 [importe] => 465 [tipo_de_pago] => Credito ) )
And I want to show it in a table, but I do not know how to do it dynamically since what I could do is put it "manually" occupying a lot of space and nothing practical, here an example of only what I've done for a Registration only:
<div class="tableFixHead">
<table class="table table-striped">
<thead>
<tr>
<th class="col-xs-2">Fecha del pago</th>
<th class="col-xs-2">Monto</th>
<th class="col-xs-2">Concepto</th>
</tr>
</thead>
<tbody>
<td>
<?php
if (!empty($pagos_unicos_del_ID[0]->fecha_del_deposito)) {
print_r($pagos_unicos_del_ID[0]->fecha_del_deposito);
} else {
print "Sin registros";
}
?>
</td>
<td>
<?php
if (!empty($pagos_unicos_del_ID[0]->importe)) {
print_r($pagos_unicos_del_ID[0]->importe);
} else {
print "Sin registros";
}
?>
</td>
<td>
<?php
if (!empty($pagos_unicos_del_ID[0]->tipo_de_pago)) {
print_r($pagos_unicos_del_ID[0]->tipo_de_pago);
} else {
print "Sin registros";
}
?>
</td>
</tbody>
</table>
</div>
As a result:
Someone who can support me to an optimal solution for this?
Thanks in advance.