Answer the question
In order to leave comments, you need to log in
Track changes to a specific field in the database, perhaps?
There is a table in the database, is it possible to track that a specific field has changed and only that! Let's say we have a table with fields name, phone, city. Need to track the city field. If the name or phone number changed, then no events, but if the city field changed, there is an event and it needs to be tracked? How can it be done?
Answer the question
In order to leave comments, you need to log in
Use triggers:
CREATE TRIGGER `after_update_table_name` AFTER UPDATE ON `table_name`
FOR EACH ROW BEGIN
IF `OLD`.`field_name` <> `NEW`.`field_name` THEN
# Your action
END IF;
END
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question