Help on a query

Discussion in 'PHP' started by baris22, Jul 10, 2009.

  1. #1
    Hi everybody,

    I need some help. How can i display results according to last and topic_no? Last field has got time which i am using to show replies on topics.

    
    
    $query = "SELECT id, title, description, last, topic_no FROM web ORDER BY topic_no DESC LIMIT $start, $limit";
    
    
    PHP:

     
    baris22, Jul 10, 2009 IP
  2. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #2
    That's not a lot of information to go on, but I will take a stab at it. You can have more than one field in your 'ORDER BY' clause. For example:

    '...ORDER BY last DESC, topic_no DESC...'


    If this doesn't answer your question, post some sample data, how it is being returned and how it is supposed to be returned.
     
    plog, Jul 10, 2009 IP