Jump to content


Photo

second sort?


  • Please log in to reply
3 replies to this topic

#1 chico1st

chico1st
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 10 August 2006 - 01:13 AM

okay i need to sort articles by date first then within date by author name... is there a command for this or does it get complicated?
any help will be great
THANKS!

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 August 2006 - 01:15 AM

ORDER BY date, author_name?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 chico1st

chico1st
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 10 August 2006 - 01:38 AM

Okay i just went to implement this and i realized that they are in different tables.
The only solution i can think of is to read one month's worth of articles into an array.
sort that array by author name then move on to the next month
this would work but it seems very cumbersome
Any ideas?
THANKS!


#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 August 2006 - 02:08 AM

Different tables? Well, if you JOIN them, you can use whatever columns from either table to ORDER (though you may incur a filesort).
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users