Forum Moderators: coopster
I have a database wit ha date field in it. I have a promotional spot on my home page. The date in the database is the date that I want the promotion to run. I want to run a query that only brings back the records that are within 30 days of todays date. I've tried various date manipulation stuff in mysql but not got it wot work just right.
Can anyone help?
Thanks,
$thirty_days_ago = mktime()-2592000; // Current Unix timestamp minus thirty days
SELECT * FROM `table` WHERE `date` > $thirty_days_ago;