Jump to content

WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) Need an END DATE suggestion please


0o0o0

Recommended Posts

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

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.