Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- last update
July 14, 2005, 4:34 pm
rate this thread
Re: last update
Maybe, for rows. A timestamp field (well, the first one) is
automatically set to the current time when the row is modified, or
when the row is created, UNLESS it is explicitly set to another
time other than null. So if you handle it properly, you've got a
row-last-modified-time field. Insert it as null (or leave it out
of the field list), and don't update it at all. It will be maintained
for you. But it is easy to fake it by explicitly setting that field
to something else.
Table modification times are available with SHOW TABLE STATUS.
These may be more recent than expected due to things that might not
be considered modifications, like OPTIMIZE TABLE, which doesn't
really change any of the data.
There's no place to store a modification time for every field, and
no automatic way of updating them, unless you use triggers (available
in MySQL 5.0). Then you could have an automatically-maintained
update log (field FOO of table BAR changed from %s to %s at <time>
by <user>) in another table used to track the changes.
Gordon L. Burditt
- » The most optimize way to store and seach chinese character in MySQL 4.1
- — Previous thread in » MySQL Database Forum
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum