-3
A query via mysqli (in PHP) returns me 90 lines in an array. How do I print a maximum of 20 lines on each page ? I developed it as follows, but it’s still too grotesque:
Can someone help me perfect that code ?
<?php
$linhas = 92;
$i = 1;
while ($i <= $linhas) :
echo $i . "<br>";
$i++;
while ($i % 20 == 0) :?>
<div style="page-break-before: always"> <?= $i ?> </div> <?php
$i++;
endwhile;
endwhile;
?>
Even better:
LIMIT 0, 20
to the front page,LIMIT 20, 20
for the second, and so on.– bfavaretto
Good idea, I hadn’t thought of that.
– Nay-ton