That's not 100% correct
If you have more than one TIMESTAMP field only the first (IIRC) will be filled with the current time - other TIMESTAMP fields will only be filed if you set them = NULL.
This is true of MySQL < 4.1.2 - there is more fine-grained control over the behaviour from 4.1.2 onwards.
Note that for < 4.1.2 the first TIMESTAMP field will also be automatically set on UPDATE.
Hope this helps
Cheers
Chris
Andrew Kreps wrote:
On Tue, 21 Sep 2004 16:25:37 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
i need to insert a current timestamp into a mysql field when a form is posted. can anyone suggest a simple way of doing this?
Here's the MySQL answer: If you have a (data type) timestamp field in your table, you don't need to do anything. MySQL will automatically fill it in on insert, and update it when you run an update query.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php