W
W
WebDeveloper20162016-08-25 11:15:27
MySQL
WebDeveloper2016, 2016-08-25 11:15:27

Trigger for data change?

Let's say we have a product table. It has an updateTime column. It is necessary to write down DATETIMESTAMP in it at any change of the data in this table. Those. recent changes. I think you need a trigger. Please help me write.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2016-08-25
@WebDeveloper2016

The trigger is not needed, mysql can do this on its own. ON UPDATE CURRENT_TIMESTAMP in a column declaration.
https://dev.mysql.com/doc/refman/5.7/en/timestamp-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question