PHP MySql and limiting results
Posted: Tue Jun 11, 2002 11:22 am
I've got a page that has sql that returns x number of rows...i only want to display 10 per page....and then have a Page 1, 2, 3 etc link....i know i can limit the records returned by doing limit 10 or limit 5, 10 at the end of my sql....but what about knowing how many i've got total so that i know how many page links i need to display...
for instance if i've got 47 total records i want to display Page 1,2,3,4,5 as links to forward through the results....i know i can do a select count(*) from xxxx.....but i'm sure there is another way another than performing and additional query....
and what about the php code to handle those page numbers...anyone got an example i can look at...
thanks
for instance if i've got 47 total records i want to display Page 1,2,3,4,5 as links to forward through the results....i know i can do a select count(*) from xxxx.....but i'm sure there is another way another than performing and additional query....
and what about the php code to handle those page numbers...anyone got an example i can look at...
thanks