Closed Thread
Results 1 to 2 of 2

Thread: Order By

  1. #1
    Pro Member agent007 is an unknown quantity at this point
    Join Date
    Sep 2001
    Posts
    303

    Order By

    Hm, okay, is it possible to use two ORDER BY commands in an SQL statement? For example:

    mysql_query("SELECT * FROM pmessage WHERE username = '$username' ORDER BY date,sticky_status DESC");

    Right now, I'm (trying) to make a PHP private message script for my site. There's an option for users to pin the message to the top of their inbox. Right now, if there is a ,sticky_status after the ORDER BY date, the messages go in reverse order (instead of going from newest -> oldest, they go oldest -> newest), so it's a bit strange. if the ,sticky_status isn't there, the messages are in correct order by the pinned posts won't be at the top.

    If you don't understand, I'll try to elaborate even more.

    Anyone?
    EterNETy - Connecting artists and writers across the world.

  2. #2
    Pro Member agent007 is an unknown quantity at this point
    Join Date
    Sep 2001
    Posts
    303
    Never mind. I found a way.
    EterNETy - Connecting artists and writers across the world.

Closed Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts