Working on a small calendar project where there is an event date and display dates -- on and off. I have controled this with three fields in mysql: event_date, date_on, and date_off. All of the fields default to 0000-00-00, but I'd like to change that to today's date for date_on, and have date_off default to whatever is sent in event_date (which might not even be possible). One thing's for sure -- refman says I'd have to change all to the timestamp type to do anything like this (and I can only record the current timestamp).
So, is all hopeless in mysql and must be hardcoded in php?
viewing a particular calendar page could fire something like this
UPDATE `table` SET `date_on` = DATE_ADD(`event_date`, INTERVAL -1 MONTH); WHERE `date_on` = '0000-00-00'
will that work?