O
O
okovalev2018-07-06 05:15:13
MySQL
okovalev, 2018-07-06 05:15:13

How to set the current date and time in a field with the DATETIME type for any creation and modification of a row using sql?

Now the field has:

`datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP

If a row is added to the table, then the current date and time will be set by default.
How to do the same when updating a row?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kisaa, 2018-07-06
@okovalev

Create a trigger on Update in the database?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question