Welcome Guest, Not a member yet? Register   Sign In
Session for pagination


I have a massive table and want to use for pagination purposes. When I search something, I get 5000 records and it takes about 5 seconds. Everytime I navigate through I have to send another query to database with limit and offset. If I store results in a database session once, can I re-use that session for pagination purposes? If so, how do I do it? Or is there any better way?


You can also look into query caching. It's cheap and very effective. Just remember to delete the cache for items when the data gets updated.

And, CI has a built in pagination class, have you looked into that?

I tried CI's query caching but it is a bit problematic when it comes to deleting cached query file in cache folder. I'll use phil sturgeon's partial caching library instead.

For the CI Pagination, I cannot number returned rows in table, like 1,2,3,4..... E.g. Only NAME, SURNAME fields come from database.


Theme © iAndrew 2016 - Forum software by © MyBB