silvercover Posted January 9, 2015 Share Posted January 9, 2015 I have a MySQL query that returns rows containing date_add column like below: DATE(date_add) 2014-01-07 2014-01-07 2014-01-07 2014-01-07 2014-01-08 2014-01-15 2014-01-20 2014-01-20 2014-01-20 2014-01-26 2014-01-28 2014-02-16 2014-02-16 2014-02-16 2014-02-16 2014-02-16 2014-02-16 2014-02-16 2014-02-18 2014-02-18 2014-03-08 2014-03-08 How can I have pagination based on dates and show rows with the same date in a page and not just based on predefined limit number? Quote Link to comment https://forums.phpfreaks.com/topic/293777-paginate-rows-day-by-day-in-phpmysql/ Share on other sites More sharing options...
mac_gyver Posted January 9, 2015 Share Posted January 9, 2015 you would actually do 'date-ination', where your links cause specific or next/previous dates to be selected, not logical page numbers. you can get a unique list of distinct dates and make a link for each one, displaying only the first one, a small range around the currently selected date, and the last one and/or you can make links with the currently selected date and a next/previous flag that would query for the next highest or lowest date from the selected date. if your dates can have a large number of results for any day, you may still want to have traditional pagination for the results. your links would just be built with the 'date-ination' selection and the logical page numbers for the pagination. Quote Link to comment https://forums.phpfreaks.com/topic/293777-paginate-rows-day-by-day-in-phpmysql/#findComment-1502293 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.