Page 1 of 1

Array sorting// DB queries

Posted: Mon Jun 16, 2003 3:55 am
by Seattlebadboy
Ok, here is my problem. I am trying pull information from a database and then sort the results. The tricky part IS what I want to sort by, is the actual variables stored within a field. So for example, say I have 4 fields in my db table ( Name, State, Gender and Age ) - and I want to sort by the state of California, Oregon, Arizona and Utah. I can sort by State in my db query, but not by specific states. Does anyone what any ideas on this?

Thanks in advance.

Posted: Mon Jun 16, 2003 3:59 am
by twigletmac
Moved to PHP - Normal, as this is a 'how to' question.

Mac

Posted: Mon Jun 16, 2003 5:04 am
by twigletmac
Could you expand a bit on what you are trying to do - are you trying to have it so that California, Oregon, Arizona and Utah appear first and the other states after them?

Mac

Posted: Mon Jun 16, 2003 5:07 am
by Seattlebadboy
Yeah, basically I have to sort it by California first, then Oregon, Arizona and Utah. It has to be in that order.