This is my query.
SELECT *
FROM `mystores`
WHERE `status`='0'
AND DATE(`create_date`) < '2014-10-23'
AND DATE(`create_date`) > '2014-10-17'
and it shows all the records between 2014-10-18 and 2014-10-22. Now I want only 2014-10-18, 2014-10-20 and 2014-10-22 date's records. If I run this query tomorrow, it should show 2014-10-19, 2014-10-21 and 2014-10-23
and My PHP code:
$sql="SELECT * FROM `mystores` WHERE `status`='0' AND DATE(`create_date`) < '".date("Y-m-d", strtotime("-1 day"))."' AND DATE(`create_date`) > '".date("Y-m-d", strtotime("-7 days"))."'";
Is there any possible to get these records? Thanks
SELECT *
FROM `mystores`
WHERE `status`='0'
AND DATE(`create_date`) in (curdate() - interval 2 day,
curdate() - interval 4 day,
curdate() - interval 6 day)