Syntax error in Mysql Trigger 1 -


where syntax error in code? can't find... code:

 create trigger `devices_update` before update on `devices`  each row begin     if new.status <> old.status         insert `test`.`devices_history` (`ip`, `status`, `date`) values (old.ip_address, new.status, now());     end if; end 

he says error:

sql (1064): have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 4 */


Comments