All the examples I've found seem the same as my code, yet I am having a hard time getting it to work. Here's the table,
CREATE TABLE `samfoo` (
`test` varchar(10) default NULL,
`trig_field` varchar(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
And here's the trigger:
DELIMITER $$
DROP TRIGGER IF EXISTS footrigger$$
CREATE TRIGGER samtrigger
BEFORE INSERT ON samfoo
FOR EACH ROW
BEGIN
SET trig_field = 1;
END$$
DELIMITER ;
When I run this, I get the error Unknown system variable 'trig_field'. Any ideas?