查询mysql表并获取3天内发布的行

how can i query my mysql database and fetch rows which are posted in earlier 3 days

i know how to fetch todays's rows but not 3 days ago

time will save in my table like this :

2010-01-20 19:17:49

and this is what i know :

SELECT id FROM pages WHERE date=now()

but i need to show posts in 3days

and im looking for a simple and straight solution ,because i know how to do so in long php codes

To get records three days in the past up to current time:

SELECT t.id
  FROM PAGES t
 WHERE t.date BETWEEN DATE_SUB(NOW(), INTERVAL 3 DAY) AND NOW()

Would be helpful to know what version of MySQL you're using and what column type we're talking about but here's the reference of Date and Time Functions for 5.1. You're going to probably want DATE_SUB().

This should select all entries with a date value after and including 3 days ago:

Select id From pages Where NOW() >= Interval date day + 3

Note that if there are dates in the future this will select them too.