Hi,
I have a table that when queried will come up with results like:
1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 22, 23, 24, 25, 30, 35, 40, 41, 42, 43 etc
What I want to do is display the results like this:
1 - 6, 10 - 13, 22 - 25, 30, 35, 41 - 43
and then have the user click on lets say 1 - 6 and have another page display the 1, 2, 3, 4, 5
any help??
thanks
Group Results
Moderator: General Moderators
-
charlielha
- Forum Newbie
- Posts: 5
- Joined: Mon Jun 19, 2006 1:59 pm
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Group Results
These are some terribly odd ranges. I am not sure there is logic appropriate to produce ranged data sets like this. You can do it in code, but again, with this add of a logic for your ranges, you may be up against quite a bit of programming.charlielha wrote:Hi,
I have a table that when queried will come up with results like:
1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 22, 23, 24, 25, 30, 35, 40, 41, 42, 43 etc
What I want to do is display the results like this:
1 - 6, 10 - 13, 22 - 25, 30, 35, 41 - 43
and then have the user click on lets say 1 - 6 and have another page display the 1, 2, 3, 4, 5
any help??
thanks
-
charlielha
- Forum Newbie
- Posts: 5
- Joined: Mon Jun 19, 2006 1:59 pm
How would my query look and what results would i get?Oren wrote:Then add this to your query: LIMIT offset, row_count
Could I do it by creating arrays?? Basically having an array get reocrds till is sees a result that is not sequential, then the code will create a new array.
So I would have an array for each group of records.
Could I hold this arrays on another main array?