4
I’m not getting to make a loop in the table, it’s making loop to every bank search.
$dbc = mysqli_connect('senha_adm');
$query = "select carro, barco, aviao, moto, triciclo, velotrou, dataCadastro from agencia";
$result = mysqli_query($dbc, $query);
while ($row = mysqli_fetch_array($result)) {
?>
<table id="tabela">
<tr>
<td>Carros</td>
<td>Barcos</td>
<td>Avioes</td>
<td>Motos</td>
<td>triciclos</td>
<td>Velotroes</td>
</tr>
<tr>
<td><?php echo $row['carro']; ?></td>
<td><?php echo $row['barco']; ?></td>
<td><?php echo $row['aviao']; ?></td>
<td><?php echo $row['moto']; ?></td>
<td><?php echo $row['triciclo']; ?></td>
<td><?php echo $row['velotrou']; ?></td>
</tr>
<?php
}
echo " </table>";
First try to elaborate the question better, instead of just pasting the code. And as a suggestion, use the title to briefly inform the problem. Otherwise it is difficult to help.
– user28595
Generally the foreach is placed in the
<tr>
.– Wallace Maxters
Better you review your code this while with a whole table, with ID still, inside and with a lot of html inside is not good.
– Wagner Viana