Correct way to fetch posts which are posted 3 days ago?

victor15

New Member
My data has a column named "date" which includes post dates in unix date format. I am using this query to fetch posts which are posted 3 days ago\[code\]$result=mysql_query("SELECT * FROM track WHERE FROM_UNIXTIME(date,'%Y-%m-%d %h:%m:%s') > NOW() - INTERVAL 3 DAY ANDFROM_UNIXTIME(date,'%Y-%m-%d %h:%m:%s') < NOW() - INTERVAL 2 DAY");\[/code\]This works, however, it selects posts by date which are in range of -48 hours and -72 hours.But I want to fetch posts by day names. I mean, for example if a post added 40 hours ago, now its not theorically 48 hours (2 days) but if we look at the day name, it was 2 days ago. How can I fetch posts like that ?
 
Top