Welcome Guest, Not a member yet? Register   Sign In
Problem with cache data
#8

(This post was last modified: 08-31-2016, 06:09 AM by PaulD.)

You mean do it in the controller? Yes I suppose but it seems a strange thing to do. Again it is NOT a reference number, if it was you would not be having this problem.

In the controller you get all the results, cache them if you want to. Loop through them and add to each row a field for count #1,2,3 and, if there is a search being done: another field for if the row matches the search criteria or not. Output to page.

On the page, if there is a search, only show rows that have been marked as matching the search. This will keep the integrity of the original count but only display the search results.

This all seems mad though.

Did you mean that when you use pagination and go to page 2, the row number still starts at 1. That is easily solved by just setting your counter to the page number minus 1 times the number of results per page + 1

PHP Code:
$counter = (($page_number 1) * ($results_per_page) ) + 1

So page one starts at counter=1, page 2 starts as 21 (assuming 20 results per page), page 3 at 41 etc,

Is that wahy you meant?
Reply


Messages In This Thread
Problem with cache data - by StratoKyke - 08-30-2016, 04:38 AM
RE: Problem with cache data - by StratoKyke - 08-30-2016, 11:22 AM
RE: Problem with cache data - by StratoKyke - 08-31-2016, 04:13 AM
RE: Problem with cache data - by PaulD - 08-31-2016, 04:23 AM
RE: Problem with cache data - by StratoKyke - 08-31-2016, 04:31 AM
RE: Problem with cache data - by PaulD - 08-31-2016, 04:51 AM
RE: Problem with cache data - by StratoKyke - 08-31-2016, 05:02 AM
RE: Problem with cache data - by PaulD - 08-31-2016, 06:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB