Hi ,
I need a little help in my mysql search script.
When it shows the results, i have 10 itens per page and at the botton of page shows the next pages, like:
(1) (2) (3) (4) (5) (6) next>>
But for a large amount of results i will have a large number of pages, like:
(1) (2) (3).......(58) (59) next>>
and surpass the html weight.
I would like to show this large number of pages limiting like:
<>
limiting to show a X number of pages at the bottom of results.
If someone could help....
follow my code:
if($debut==\"\"){$debut=0;}
$debut=$page*$limit;
////sql commands
if ($page>0)
{
$precedent=$page-1;
print \"prev \n\";
}
$i=0;$j=1;
if($nb_total>$limit)
{
while($i<($nb_total/$limit))
{
if($i!=$page){echo \"$j\";}
else {echo \"($j) \";}
$i++;$j++;
}
}
if($debut+$limit<$nb_total)
{
$suivant=$page+1;
echo \"next\";
}
}