DelphiFAQ Home Search:
General :: Databases :: mysql
General information about mysql - how to get around the differences between version 3.33 an 4, how to do stuff that you think you need a nested query for etc.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

My timestamp field in mysql does not update


To track changes in our database, I added two columns to all my tables named


The timestamp field should get updated every time any other column gets updated. For some tables this works, for some it does not. Why is that?


This behavior sounds like you are using a mysql version prior to 4.1.2. And in those tables where it does not work, you probably have another field of type TIMESTAMP already.


In mysql with versions before 4.1.2 the first TIMESTAMP column in automatically is set to the current timestamp when the record is created if the field value is set to NULL or not not specified at all. During updates the first TIMESTAMP column in table row automatically is updated to the current timestamp when the value of any other column in the row is changed, unless the TIMESTAMP column explicitly is assigned a value other than NULL.

Generated 4:00:28 on Sep 21, 2020