Array sorting// DB queries

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Seattlebadboy
Forum Newbie
Posts: 11
Joined: Mon Jun 16, 2003 3:55 am
Location: Seattle, WA
Contact:

Array sorting// DB queries

Post 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.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Moved to PHP - Normal, as this is a 'how to' question.

Mac
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Seattlebadboy
Forum Newbie
Posts: 11
Joined: Mon Jun 16, 2003 3:55 am
Location: Seattle, WA
Contact:

Post by Seattlebadboy »

Yeah, basically I have to sort it by California first, then Oregon, Arizona and Utah. It has to be in that order.
Post Reply