I'm creating eBay style search panes that allow users to narrow their results set by certain criteria. For example:
Tags
Literature (8) Fiction (4) English (4) American (3) Non-fiction (2)
The number of results which have that property is in brackets. Initially, I built the counters by putting this code in my display results loop:
if(isset($tags[$row['tags']])) {
$tags[$row['tags']]++;
} else {
$tags[$row['tags']] = 1;
}
Then I paginated my results and that stopped working - the query only returns enough data for the page you are on, so the counters only represent the results on that page.
Can anyone suggest another approach?