I have the following trigger:
DELIMITER //
CREATE TRIGGER historyTrigger AFTER UPDATE ON Item
FOR EACH ROW
BEGIN
if NEW.LocationId <=> OLD.LocationId or NEW.PersonId <=> OLD.PersonId THEN
insert into History values(null, old.Id, old.LocationId, new.LocationId, old.PersonId, new.PersonId, date(now()));
END IF;
END;//
DELIMITER ;
which worked correctly on my database.
However, when I try to create this same trigger in phpMyAdmin, I get a syntax error (#1064 - You have an error in your SQL syntax; ... near line 1)
Edit:
Having seen some other questions and examples online, and following the advice in the comments, I only left the body of my trigger:
if NEW.LocationId <=> OLD.LocationId or NEW.PersonId <=> OLD.PersonId THEN
insert into history values(null, old.Id, old.LocationId, new.LocationId, old.PersonId, new.PersonId, date(now()));
but I am still getting the same error, at line 2.