jentino28 Posted July 6, 2006 Share Posted July 6, 2006 Hi guys, I looked around and googled but can't find a straight answer.I designed a website where i have my links as : Today | Yesterday | Past 5 days | Past 7 days | Past monthi can do "today" and "yesterday" mixing php's time functions and mysql but im struggling with "7 days". i attempted using DATE_SUB(CURDATE(),INTERVAL 7 DAY); but it only pulls queries found on the last 7th day, not between now and seven days.which is what im looking for.Please help me. thanks. ;) Quote Link to comment https://forums.phpfreaks.com/topic/13823-mysql-date-search/ Share on other sites More sharing options...
fenway Posted July 6, 2006 Share Posted July 6, 2006 You want "WHERE yourDateColumn - INTERVAL 7 DAY <= NOW()". Quote Link to comment https://forums.phpfreaks.com/topic/13823-mysql-date-search/#findComment-53956 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.