NYCPHP Meetup

NYPHP.org

[nycphp-talk] Modified and created times using DB_DataObject

Mitch Pirtle mitch.pirtle at gmail.com
Sun Nov 27 21:23:53 EST 2005


On 11/27/05, Mike Brittain <mike at mikebrittain.com> wrote:
>
> I had considered a timestamp for the modified column, and currently have
> that in place.  I am also thinking that if the application could handle
> this on it's own, then it wouldn't be exposed to automatic changes in
> timestamp if I had to do manual administration on the database tables.
>
> Also, the "created" column can't be a timestamp, otherwise it will
> update every time the record is changed.  I want this column to reflect
> only its own creation time.

This is a perfect scenario for triggers, IMHO. That way you can avoid
the use of timestamps and control how the values are manipulated.

However you are right with the notion that manual changes to the data
will also change the 'last_edit' values, so I can only give this
advice with a grain of salt ;-)

-- Mitch



More information about the talk mailing list