|
Posted by Jerry Stuckle on June 1, 2008, 9:24 am
Please log in for more thread options gafow wrote:
show/hide quoted text
> $results = mysql_query($query);
> con_query($result);
> while($pages = mysql_fetch_array($result)){
> echo "<span class=\"btext\" > |". $pages['pia']."</span>";
> echo "<span class=\"btext\" > | ". $pages['order'] ."</span><br>";
> }
> }
>
> $pages[1-300] -pages
>
> to make links
>
>
> Thank you very much
Figure out how many items you want per page. Now get a count of the
number of items which would be retrieved and divide by the number of
items per page. This will give you the number of pages (after
accounting for a possible partial page, of course).
For instance - if you want 10 items per page, the easiest way would be:
$numpages = intval(($itemcount + 9) / 10);
Now figure out what page you're on, and fetch the entries from the
database just for that page.
And if you need help with the SQL end, check comp.databases.mysql.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
|
echo "<span class=\"btext\" > | ". $pages['order'] ."</span><br>";