It should be simple, but I messed with him and didn’t get anything I wanted. I have the following code:
SELECT id,title,start_date
FROM events
WHERE start_date > DATE_SUB(NOW(), INTERVAL 1 MONTH)
AND city = '$cityName'
ORDER BY start_date DESC
Now it selects events with dates in this month, but the definition of that month shown in the request is different from what I need. I need this to show me events for 30 days, and not only this month, that is August. If I insert an event in August, it shows the result. If I insert September, this is even though it is less than 30 days.
source
share