Assuming I have a database with X elements! At the time of the query I'm going to use count
to see how many rows I have! I would like to divide this result and divide by any number, in this case I will use the value of 3, taking into consideration that I had a return of 9 lines, the result will be 3!
So at the time of echo
, I would like to insert one for div
in "back" of every 3 results. I would like the result to look like this!
<div class="inserida_pela_php">
<div class="div_qualquer"> 1 </div>
<div class="div_qualquer"> 2 </div>
<div class="div_qualquer"> 3 </div>
</div>
<div class="inserida_pela_php">
<div class="div_qualquer"> 4 </div>
<div class="div_qualquer"> 5 </div>
<div class="div_qualquer"> 6 </div>
</div>
<div class="inserida_pela_php">
<div class="div_qualquer"> 7 </div>
<div class="div_qualquer"> 8 </div>
<div class="div_qualquer"> 9 </div>
</div>