How do i rank my search result

Discussion in 'PHP' started by adsegzy, Jul 18, 2010.

  1. #1
    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
     
    adsegzy, Jul 18, 2010 IP
  2. adamsinfo

    adamsinfo Greenhorn

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    $query = "SELECT class_of_member WHERE item_posting = 4";
    $res = mysql_query($query);
    $obj = mysql_fetch_object($res);

    if ($obj->class_of_member == 1)
    {
    ...
     
    adamsinfo, Jul 18, 2010 IP
  3. Epiic

    Epiic Greenhorn

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    You can try: $query = "SELECT items FROM database ORDER BY class DESC";
     
    Epiic, Jul 18, 2010 IP