CodeIgniter Forums
How to implement pagination on number and alphabet at the same time [CI3] - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: How to implement pagination on number and alphabet at the same time [CI3] (/thread-74167.html)



How to implement pagination on number and alphabet at the same time [CI3] - pureexe - 08-08-2019

Pagination on the number of pages but if i want to view data start with K, i click on 'K' and its jump to page 33 which is a page that starting with k letter. How to implement something like this? 

select all data to find the K starting point look waste of resource (because we need to find other 25 letter starting point too) any better way to implement this?

for example: *REDACTED*
[Image: jqTDttt.jpg]


RE: How to implement pagination on number and alphabet at the same time [CI3] - includebeer - 08-08-2019

I think you will have to do as you say: select all the titles and find the right page number.
But you can cache the result for better performance and not do this at each page load: https://www.codeigniter.com/user_guide/libraries/caching.html


RE: How to implement pagination on number and alphabet at the same time [CI3] - includebeer - 08-08-2019

Also can you please not post porn site as example!  Dodgy


RE: How to implement pagination on number and alphabet at the same time [CI3] - pureexe - 08-08-2019

(08-08-2019, 07:00 AM)includebeer Wrote: I think you will have to do as you say: select all the titles and find the right page number.
But you can cache the result for better performance and not do this at each page load: https://www.codeigniter.com/user_guide/libraries/caching.html

Thank you for your suggestion. and sorry about example link ;-;