Reputation: 323
I have this query
SELECT * FROM content
WHERE topic='$rw09[id]' AND active='1' AND date < DATE_SUB(CURDATE(), INTERVAL 1 WEEK)
ORDER BY cpc DESC, id DESC
LIMIT 4
The key part of my query is date < DATE_SUB(CURDATE(), INTERVAL 1 WEEK)
. It returns me entries older than a week. What i want it to return me is entries NOT older than 1 week. How can i modify it to return me desired result?
Thank you.
Upvotes: 1
Views: 2724
Reputation: 396
Have you tried with
SELECT * FROM content
WHERE topic='$rw09[id]' AND active='1' AND date > DATE_SUB(CURDATE(), INTERVAL 1 WEEK)
ORDER BY cpc DESC, id DESC
LIMIT 4
?
Upvotes: 4