Re: mysql timestamp field

From: Date: Thu, 06 Sep 2001 20:54:59 +0000
Subject: Re: mysql timestamp field
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-66277@lists.php.net to get a copy of this message
In article <20010906105702.B18768@unwosrv5.unoh.edu>, jpstech@unoh.edu (Jason Stechschulte) wrote: > > I need an update on my table. but I have a timestamp field called > > t_stamp. When I update a field other than t_stamp field, t_stamp field > > also updates to now(). I need it not to update and saves its value. > > > > How should I do this? > > The easiest way is to change the column type. Timestamp always updates > itself whenever the row is updated. To be more precise: the *first* timestamp field in a table always updates itself whenever the row is updated. > You could simply change the column > type to datetime. Yep. Or add another timestamp column before t_stamp. But unless you have use for this auto-updating value (and it doesn't sound like you do), the first suggestion is the better one. -- CC

« previous php.general (#66277) next »