If got a simple trigger which is to update a log table (which I unfortunately need), however if the value of `phoneNumber` is its default of Null, when I update it like:-
UPDATE `contract` SET `phoneNumber` = '44464' WHERE `contract`.`priID` = 8;
I dont get a line in the logger, however if I execute again differently so the so OLD.`phoneNumber` isnt null then trigger fires fine and runs the insert command.
My trigger code is:-
IF OLD.`phoneNumber` <> NEW.`phoneNumber` THEN
INSERT INTO `mobilephones`.`_logger` (`dateTime`, `connectionID`, `table`, `priID`, `feild`, `newValue`,`action`) VALUES (NOW(), CONNECTION_ID(), 'contract', NEW.`priID`, 'phoneNumber', NEW.`phoneNumber`, 'Update');
Any ideas what Im doing wrong?