Jump to content

Selecting a random row from the 5 most recent entries


DrDankWD

Recommended Posts

Hello,

I am trying to figure out something for a news module. I would like to display a random news article from the database, but I would like to limit it to the 5 most recent news posts.

 

For instance:

  There are 25 dated articles in the database, Out of the 5 most recent I would like to pick one to display.

 

I am not sure how to write this query, any help would be much appreciated.

 

Thanks

DrDankWD

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.