How to sort rows in the table by column names

Discussion in 'Programming' started by vad111, Jun 19, 2008.

  1. #1
    Hi there,
    I am using Wordpress 2.5 with custom PHP pages, this is one of them:
    http://compare-forex.com/comparison-tables/automated-forex-trading-software/
    The question is how can I make this table to get sorted by the "Average Rating" automatically when some one rates some item? So that rows with most rating will appear on the upper part of the table and vice versa.
    Is there any way to make this table sortable by column names?
    Thanks,
    Vad
     
    vad111, Jun 19, 2008 IP
  2. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #2
    See SQLs "ORDER BY" clause to order by column names.

    The only problem might be sorting by an averaged column, presumably calculated from another table somewhere. That's a whole different kettle of fish.
     
    Synchronium, Jun 19, 2008 IP
  3. vad111

    vad111 Active Member

    Messages:
    140
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #3
    I have no idea how to to that.
    All html data is in the static page except rating, I use wp-postratings plugin.
    this code: <?php the_ratings('div', 21); ?> I inserted into static page where 21 is a post#
    What should I do exactly?
    Thanks
    Vad

    p.s.I have no programming knowledge
     
    vad111, Jun 19, 2008 IP