convinceme Posted October 12, 2007 Share Posted October 12, 2007 I am not quite sure its more related to maths or php anyway Problem: I want to show the last post in a mysql table. And i am displaying them with a limit of 10, i.e. 10 results per page. Now i have a problem figuring it out what would be the starting point of the results display in this case. I know it sounds confusing so let me give a few examples to illustrate my point. Example 1: Last Id = 15. So now we want to display with a limit starting from 10 Example 2: And if the last id = 22 we want to display with a limit starting from 20 because remember we want to show 10 results on each page. The problem is to figure out which was the last '10' starting point, which in example 1 would be 10 and in example 2 be 20. Quote Link to comment https://forums.phpfreaks.com/topic/72902-displaying-last-result-from-a-mysql-table-with-a-limit-of-10-results-per-page/ Share on other sites More sharing options...
Aureole Posted October 12, 2007 Share Posted October 12, 2007 You may want to take a look at one of the pagination tutorials on the main site. Quote Link to comment https://forums.phpfreaks.com/topic/72902-displaying-last-result-from-a-mysql-table-with-a-limit-of-10-results-per-page/#findComment-367691 Share on other sites More sharing options...
convinceme Posted October 12, 2007 Author Share Posted October 12, 2007 ok ahmm no its not about pagination... i know how to do that its just that how to figure out the nearest 10. using LIMIT would paginate it.. but the starting point is the problem.. if the last id is 24 how to make sure the limit starts from 20 thats my point... i want it to be dynamic if that makes any sense Quote Link to comment https://forums.phpfreaks.com/topic/72902-displaying-last-result-from-a-mysql-table-with-a-limit-of-10-results-per-page/#findComment-367705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.