Can I use phpMyAdmin or MySQL to check when a record was made or changed without a timestamp column?

Scenario.

A simple database that has a list of addresses

addressID FirstName LastName City PostCode CountyID ZoneID 

The problem is that by default this table does not have a create column or timestamp at the end. However, I have full access to MySQL through my Nginx SSH Ubuntu 11 setup - I can also enter phpMyAdmin root.

Is it possible to check, for example, when a certain record was made, is it changed, etc.?

+4
source share
1 answer

In short, no . This is not possible in 99% of cases. Especially in a MySQL environment. NoSQL and other services such as MongoDB and other environments are different.

Run this script in phpMyAdmin for future use now (you already assumed that you were going to write a stamp).

 ALTER TABLE Addresses ADD Column CreatedOrModified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; 

You can also use NULL as well as DateTime Stamp for default values. You can also send PHP data to the MySQL field:

 $stamp=$date=date("Ymd H:i:s"); 
+2
source

All Articles