0o0o0 Posted July 19, 2015 Share Posted July 19, 2015 I have this below ive used it for a couple years.. $query = "SELECT * FROM `table` WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) ORDER BY Date DESC"; Works great .. but I would like to add an ending date to it.. i've tried the below way and it works ...but I like how the above would dwindle down slowly to showing less and less information by the following month or set date.. $query = "SELECT * FROM `table` WHERE date BETWEEN '2015-06-19' AND '2015-08-01' ORDER BY Date DESC"; Need something added to WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) (example stop showing anything after '2015-08-01' or set future date.) so the viewer slowly stops seeing june 19 tomorrow.. june 20 next day.. less and less... that by September 1st the user has to contact me by phone or email because they have nothing left to see.Thanks Link to comment https://forums.phpfreaks.com/topic/297363-where-date-date_subnow-interval-1-month-need-an-end-date-suggestion-please/ Share on other sites More sharing options...
Ch0cu3r Posted July 19, 2015 Share Posted July 19, 2015 Try $query = "SELECT * FROM `table` WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND date < '2015-08-01' ORDER BY Date DESC"; Link to comment https://forums.phpfreaks.com/topic/297363-where-date-date_subnow-interval-1-month-need-an-end-date-suggestion-please/#findComment-1516757 Share on other sites More sharing options...
0o0o0 Posted July 19, 2015 Author Share Posted July 19, 2015 oh and date LESS than. Thank you sir! Link to comment https://forums.phpfreaks.com/topic/297363-where-date-date_subnow-interval-1-month-need-an-end-date-suggestion-please/#findComment-1516760 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.