Greg AllardHow To Use Triggers to Track Changes in MySQL
OLD and NEW are used on UPDATE triggers. OLD.col_names will access the data that is in the row of the database before the UPDATE query runs and NEW.col_names will access the data that the row will be updated to.
IF OLD.first_name != NEW.first_name
That checks if the UPDATE query is changing the information for first_name.
