How can I check when was the last time (timestamp) that I wrote in the database, irrespectively of the database table that I inserted into?
If you are AUTO_INCREMENT with column, then you can use last_insert_id() method. This method gets the ID of the last inserted record in MySQL.
Syntax to know the last updated time. SELECT UPDATE_TIME FROM information_schema. tables WHERE TABLE_SCHEMA = 'yourDatabaseName' AND TABLE_NAME = 'yourTableName'; Let us implement the following query to get the last updated time.
MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME .) By default, the current time zone for each connection is the server's time.
Just use this SQL: SHOW TABLE STATUS;
and check Update_time column.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With