Hi Nathj,
Please do provide the example code you promised. I need that kind of thing now.
I know TIMESTAMP fields that reflect INSERT time, but as for reflecting UPDATE and DELETE times, I' not sure I'm now certain about that.
Right now, I can kind of imagine adding timestamp update lines to all update and queries using PHP. But I imagine there's got to be an easier MySQL internal mechanism.
So, can we have it sir?
Thanks in advance.
Ifedi.
Hi,
To get the the date a particular record was updated the SQL would be:
-
SELECT editDate FROM table where id=x
-
The WHERE clause can be anything you like really it just dtermines whcih records are being checked. If you want to select the record most recently updated try something like:
-
SELECT a.is, max(editDate) as latestEdit FROM table wherex group by a.id, a.editDate
-
You'll need to play around with this psuedo code to get the where clause and group by clause correct but hopefully this should get you going.
when selecting out dates it is also possible to use date_format in MySQL to get the result in the format you want.
nathj