I have a table like this:
CREATE TABLE `shopping` (
`userid` int(9) DEFAULT NULL,
`carid` int(9) DEFAULT NULL,
`buydate` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
And I would like to create an insert trigger, which check the "buydate", and if it's greater than the current date, stop the insert, and only accept the equals or the less dates.
I'm very beginner with triggers, I readed some tutorials, but I don't get how it's work.
Thanks in advance!