RE: mysql table definition question: dates

  • From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 17 Mar 2011 16:33:24 -0400

You really should probably do an update time stamp as a trigger.  If you
don't know how to do triggers tell me what language your doing the code in
and maybe I can help.

ken

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall
Sent: Thursday, March 17, 2011 4:09 PM
To: programmingblind
Subject: mysql table definition question: dates

Hi all,
I am doing a small cms-type project for a databases class. A few of my
tables need "date created" fields, which is fine:
dateCreated timeStamp now()

However, I also want to store the date/time of the record's most
recent update. When an article is modified, for example, its
lastModified date should be updated when the update is complete, but
its dateCreated should remain unchanged. Of course, upon initial
creation, dateCreated and dateModified should be identical, but only
dateModified will change from there on. I am hoping to be able to do
this automatically instead of using php, but I am having a very hard
time finding a simple answer in the docs or google. Can anyone just
provide the basic syntax for something like this? TIA.

-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: