/ Published in: SQL
Select rows that are 3 months ahead or 3 months behind from the current date.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
'SELECT * FROM events WHERE date > DATE_SUB(NOW(), INTERVAL 3 MONTH) AND date < DATE_ADD(NOW(), INTERVAL 3 MONTH) ORDER BY date DESC'