Jump to content

Where date is closest to...


verdrm

Recommended Posts

well if you inserted NOW()

 

you can either:

mysql_query("SELECT * FROM table WHERE date > (NOW() - INTERVAL 10 DAY)")

// retrieves entries from last 10 days

 

or

 

mysql_query("SELECT * FROM table ORDER BY date DESC LIMIT 10")

// retrieves last 10 entries

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.