I'm not sure how to build a PivotTable with PHP.
I'm setting up an HTML table in which some data entered in a database will be displayed, I already created the SELECT
that brings the database information, but I'm not sure how to build the loop to display the information since the table will have 4 columns.
I tried to mount a loop FOR
but he displayed the table as follows.
Item 1 | Item 1 | Item 1 | Item 1
Item 2 | Item 2 | Item 2 | Item 2
Item 3 | Item 3 | Item 3 | Item 3
When should it show
Item 1 | Item 2 | Item 3 | Item 4
Item 5 | Item 6 | Item 7 | Item 8
Item 9 | Item 10 | Item 11 | Item 12
Loop Structure
<?php while ( $linha = mysqli_fetch_assoc($executaSelect) ) { ?>
<tr>
<?php for ($i = 1 ; $i <= 4 ; $i++) { ?>
<td><?php echo $linha["nome"]; ?></td>
<?php } ?>
</tr>
<?php } ?>