fael097 Posted July 4, 2010 Share Posted July 4, 2010 hi, i have like 93 entries on a database table, divided to show 20 per page, but i wanted to display something like "showing results 1 to 20" on each page, and on the last page, it would display "showing results 81 to 93". to get the first number, i use the same variable that i use to define where the page starts, but i dont know how to get the last entry that is being displayed. any clues? thanks in advance! Link to comment https://forums.phpfreaks.com/topic/206668-how-to-show-fetch-array-number-of-results/ Share on other sites More sharing options...
sKunKbad Posted July 4, 2010 Share Posted July 4, 2010 Look for tutorials on pagination Link to comment https://forums.phpfreaks.com/topic/206668-how-to-show-fetch-array-number-of-results/#findComment-1080901 Share on other sites More sharing options...
fael097 Posted July 4, 2010 Author Share Posted July 4, 2010 my pagination is done, i just need to retrieve this number Link to comment https://forums.phpfreaks.com/topic/206668-how-to-show-fetch-array-number-of-results/#findComment-1080931 Share on other sites More sharing options...
PFMaBiSmAd Posted July 4, 2010 Share Posted July 4, 2010 Coming up with the to x value is rather straight-forward, simply take the starting number and add the mysql_num_rows() value to it. On full pages, where you queried for 20 results, mysql_num_rows() will be 20. On the last page, mysql_num_rows() will be just the number that was actually retrieved. Link to comment https://forums.phpfreaks.com/topic/206668-how-to-show-fetch-array-number-of-results/#findComment-1080933 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.