Reputation: 279
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?
Upvotes: 6
Views: 14176
Reputation: 78981
This is basically what logging is all about.
On the CLI
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
Now, a table general_log
inside mysql
database will log all such actions on database.
Use phpMyadmin or similar to view these. You can query from their results very effectively.
Upvotes: 0
Reputation: 490
Add a field for modified date in the table and use LAST_INSERT_ID() to determine the last row (if you're doing it right away). Otherwise just retrieve the most recent date from the modified field for the table.
Upvotes: 0