Gossamer Forum
Home : Products : DBMan : Customization :

Multiple sorting ...

Quote Reply
Multiple sorting ...
Hi

I've been searching for sort of mod for allowing sorting of results by multiple columns, and haven't had much luck.
For my database, I don't have a lot of data, so although I have retained the search form for users, most of my "results" are reference directly from an HTML link which has the 'sb' and 'so' functions contained them.

My data is some sports results that form a table - like a league table. I want to first sort on Points each team have gained, then sort on 'percentage', which is goals score against score conceded. These figures are contained with the DB file in columns 8 then 7.
So I have ...

1|London Gryphons|1|0|0|1|8|108|7|0
2|North London Lions|1|0|0|1|84|91|92|0
3|Sussex Swans|1|1|0|0|91|84|108|4
4|Wandsworth Demons|1|1|0|0|59|24|246|4
5|West London Wildcats|1|1|0|0|108|8|1350|4
6|Wimbledon Hawks|1|0|0|1|24|59|41|0

So I need to sort the results fro above using column 8, then column 7, both descending.
My html would look something like:
http://www.barfl.co.uk/...;sb=8&so=descend

but I need to sort descending on column 7 as well.Unsure

Any ideas on where I could get a mod?
I am using the spreadsheet mod on my DB as well, and very pleased with it!!

Donald
Quote Reply
Re: [donny_e] Multiple sorting ... In reply to
Have you by any chance checked the FAQ (noted below) under the category "Sorting"?

There are threads there which deal with sorting on multiple fields.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Multiple sorting ... In reply to
LoisC

Thanks for your response.
I have checked the FAQ as you stated, but I'm not any wiser.
From the threads I've read through, I can do this several ways. One way to do it would be to add a mod, but as a Perl beginner, I'm not comfortable with doing that. I have tried the mod explained in another thread, but this stopped my whole script working with an Error 500.

The other option for me, which I thought might be easier, is to concatenate two fields (they are both numerical), then sort on that, but I don't want them displayed.
As I also link directly to the database (people don't really use the search function, although they could), how would I like to the results with the concatenated field hidden?

Donald