Jump to content


Photo

5 Most Recent Entries


  • Please log in to reply
1 reply to this topic

#1 bwaxse

bwaxse
  • New Members
  • Pip
  • Newbie
  • 9 posts
  • LocationFort Worth Texas

Posted 30 July 2006 - 06:19 AM

Hey all,

I am trying to set up a section of my site that displays the latest updated posts.  Each post has a dtUpdated column in the database that gets a timestamp when changed.  When Im trying to look though the database, whats the best way to get the 5 most recent?  I think im supposed to ORDER by dtUpdated DESC, but was wondering what it would look like.

I need PostID's from tbl_posts that have the most recent updates.

Thanks for all your help!
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." -AE

#2 fenway

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

Posted 30 July 2006 - 04:34 PM

You mean something like:

SELECT PostID FROM tbl_posts ORDER BY dtUpdated DESC LIMIT 5

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