To track changes to specific fields in your database, perhaps?

There is a table in the database, is there a way to track what has varied particular field and only it! Let's say we have a table with fields name, phone, city. Need to keep track of the city box. If changing the name or the phone, not the event, but if changing the box city event is and it need to track? As it is possible to do this?
April 19th 20 at 12:41
3 answers
April 19th 20 at 12:43
Use triggers:

CREATE TRIGGER `after_update_table_name` AFTER UPDATE ON `table_name`

 IF `OLD`.`field_name` <> `NEW`.`field_name` THEN
 # Your action

April 19th 20 at 12:45
to use triggers
April 19th 20 at 12:47
Trigger on field change and record in a separate table of amendments.
I don't understand how to trigger the right to write)
if update tablename (how to specify a specific field)
insert into logs value(vol, vol, vol)

field how to specify? - maxie.Mertz11 commented on April 19th 20 at 12:50
@Melisa.Reilly, IF OLD.fielf <> NEW.field - alda_Nikolaus59 commented on April 19th 20 at 12:53

Find more questions by tags SQLPHP