[PHP] How to keep a timestamp from updating?
I have a timestamp field that updates itself with NOW() every time I update the record. I don't want that to happen - I want it to remain as the original creation timestamp. How do I prevent this from happening? Thanks, - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to keep a timestamp from updating?
Hello Brian, Thursday, March 18, 2004, 3:17:49 PM, you wrote: BD I have a timestamp field that updates itself with NOW() every time I BD update the record. I don't want that to happen - I want it to remain as BD the original creation timestamp. How do I prevent this from happening? Two solutions: 1 - Don't use a timestamp - it's only doing what it is designed to :) 2 - Add another timestamp to your table before the one you want to keep static, i.e. have: modified timestamp, created timestamp Then when you update the table only the first timestamp (modified) will change, created will remain the same. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to keep a timestamp from updating?
On MySQL anyway, the timestamp is by-design, a update/insert timestamp. I quote: The TIMESTAMP column type provides a type that you can use to automatically mark INSERT or UPDATE operations with the current date and time. If you have multiple TIMESTAMP columns, only the first one is updated automatically. I suppose if you really wanted to, you could create another timestamp column, and this one would not be automatically updated. On Thu, 2004-03-18 at 10:17, Brian Dunning wrote: I have a timestamp field that updates itself with NOW() every time I update the record. I don't want that to happen - I want it to remain as the original creation timestamp. How do I prevent this from happening? Thanks, - Brian -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to keep a timestamp from updating?
From: Brian Dunning [EMAIL PROTECTED] I have a timestamp field that updates itself with NOW() every time I update the record. I don't want that to happen - I want it to remain as the original creation timestamp. How do I prevent this from happening? Set it equal to itself or use a DATETIME field. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php