Gossamer Forum
Home : Products : DBMan : Installation :

How to do a sort by multiple fields?

Quote Reply
How to do a sort by multiple fields?
I must be missing something here. Is it not possible to sort on more than one field? Right now, I'm sorting by date, but I'd like to do some sub-sorting -- e.g., by date, then priority (my own field), then country. I can't believe there's not a simple way around this . . .

Thanks.

Eric

P.S. My DBMan is currently happily running at http://www.labourstart.org -- but the sort is on one field only, the date.
Quote Reply
Re: How to do a sort by multiple fields? In reply to
At present, I don't think there is a way to sort by more than one field.


------------------
JPD





Quote Reply
Re: How to do a sort by multiple fields? In reply to
I am using Links rather than DBMan, but most likely the workaround I came up with can be plugged in to DBMan as well. What it does is take the fields you want to sort by, puts them together as one string, and then sorts by that string. This gives you the illusion of having sorted by field1 and then field2 and then field3. Concept mine, code ala Alex. See http://www.gossamer-threads.com/...um3/HTML/001199.html for the complete explanation.

Phoenix
Quote Reply
Re: How to do a sort by multiple fields? In reply to
This would be a powerful addition to DBMan if someone could figure out how to include it. I tried to use the join command as it was spelled out in the links script, but my knowledge of Perl was too limited for it to work properly in the DBMan script. As it appears to be only one line of code, can anyone tell me which line to insert -- presumably in db.cgi? Thanks!

Eric