How do i rank my search result

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
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

How do i rank my search result

Post by adsegzy »

Hello Friends,

I am building a website where the membership will be in 3 categories; class1, class2 & class3. each member in these 3 categories can add their products to my database to appear on my home page. I know how to display these added products on my home page but what i want to do is that i want the products being added by the class3 members to appear on top then follow by the products of class2 members and then products of class1 to come last. pls how do i do this.

regards,
adsegzy
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: How do i rank my search result

Post by JakeJ »

The answer to that question depends on how you are tracking who adds what? I will assume that you're displaying a product along with the member that added it. In order to display them in order of class, just add the class field of the member to your query and do "ORDER BY class DESC" so that the items are sorted by class in reverse order.
Post Reply