A tricky question !!!

Discussion in 'HTML & Website Design' started by toughguy, Jan 31, 2006.

  1. #1
    Hi Friends,
    I am looking for a solution for the following problem:

    I need display a table with say 10 columns. When the user clicks on any column name, the whole table need to be SORTED based on coulumn selected. Is there any way I can do it locally ( I mean that i don't need to go to server for fetching the data as what all i need to do is to just display the existing data in some other order).

    Any help is highly appreciated..

    Thanks a lot for viewing the issue.

    Regards,
     
    toughguy, Jan 31, 2006 IP
  2. LookingForGroup

    LookingForGroup Guest

    Messages:
    26
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    PHP + MySQL would work for that
     
    LookingForGroup, Jan 31, 2006 IP
  3. anton-io!

    anton-io! Active Member

    Messages:
    540
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #3
    anton-io!, Jan 31, 2006 IP
  4. poseidon

    poseidon Banned

    Messages:
    4,356
    Likes Received:
    246
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If the data is same than this can be done using javascript. Use arrays to store the value, and than use for loops and simple comparison operators to sort the values. If the values are dynamic than u have to use PHP + mysql.
     
    poseidon, Jan 31, 2006 IP
  5. toughguy

    toughguy Well-Known Member

    Messages:
    846
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    118
    #5
    Thanks all for the wonderful responses..

    Regards,
     
    toughguy, Jan 31, 2006 IP
  6. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I have seen a good ajax implementation of this which uses php/sql to sort the data without reloading the page.
     
    dave487, Jan 31, 2006 IP
  7. gordonfreeman

    gordonfreeman Peon

    Messages:
    169
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    go with mysql query ORDER, javascript might pose some problems on some browsers; however, you can't really do it without querying the server
     
    gordonfreeman, Jan 31, 2006 IP