I have a system from which to register the number of people in a certain establishment that goes from 1 to 200 and each establishment holds up to 3 people. How would I do that by bringing mysql this amount, be divided into blocks. For example:
How I'm currently bringing
<?php
....
$c = 1;
while($jm = mysqli_fetch_object($sqlMostrar)){
$mostrar .= "Estabelecimento " . $c . "<br>";
$mostrar .= $jm->Nome. " " .$jm->Idade;
$c++;
}
This way it brings racing and not in blocks. I would like you to bring this result as follows. Let's assume that the client has registered 09 people:
**Estabelecimento 1**
Fernando Pessoa 32 anos
Ruth Cardoso 56 anos
Santos Dumont 60 anos
**Estabelecimento 2**
Carlos Drummond de Andrade 70 anos
Mario Lago 72 anos
Manuel Bandeira 60 anos
**Estabelecimento 3**
Olavo Bilac 22 anos
Cecília Meireles 25 anos
Gonçalves Dias 55 anos