I am trying to create a trigger that changes a date on input to a unix timestamp. When i insert a value to the table the inserted value is NULL
CREATE TRIGGER `updateDate` BEFORE INSERT ON `tl_calendar_events`
FOR EACH
ROW SET NEW.startDate = UNIX_TIMESTAMP(STR_TO_DATE(NEW.startDate, '%d.%m.%Y'))
The input value for 'startDate' is like 01.11.2013
Table definition:
CREATE TABLE IF NOT EXISTS `tl_calendar_events` (
...
`startDate` int(10) unsigned DEFAULT NULL,
...
PRIMARY KEY (`id`),
KEY `pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=66 ;