Mysql List

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Geethu03
    New Member
    • Dec 2006
    • 45

    Mysql List

    Hi
    I am writing a query to list some fields in asc,and desc.i want to list the field in my won order. that is my filed name is Status, in this i stored a values High, Low and Medium. I am able to sort this field in asc and desc but i want list in High,Medium and Low and also the opposite way that is Low,Medium and High.

    How can i do this
    Pls anyone help to do this
    Thank you
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Use the ORDER BY FIELD like this:
    [php]
    SELECT * FROM table_name ORDER BY FIELD(status,'L ow', 'Medium', 'High')
    [/php]
    Ronald

    Comment

    • Geethu03
      New Member
      • Dec 2006
      • 45

      #3
      Originally posted by ronverdonk
      Use the ORDER BY FIELD like this:
      [php]
      SELECT * FROM table_name ORDER BY FIELD(status,'L ow', 'Medium', 'High')
      [/php]
      Ronald
      I solved that problem.

      Thankyou Very much for your Kindly help.

      Comment

      • Geethu03
        New Member
        • Dec 2006
        • 45

        #4
        Originally posted by ronverdonk
        Use the ORDER BY FIELD like this:
        [php]
        SELECT * FROM table_name ORDER BY FIELD(status,'L ow', 'Medium', 'High')
        [/php]
        Ronald
        Hi
        one more question to solve my problem.In system folder view we have the option to show the file name in asc and desc and the same way show the file size,date modified. in the same way i want to print the above status in my application. but i don't have any idea for that so give me a suggestion how can i do that.

        Thankyou very much
        Geethu

        Comment

        Working...