Hi.
What you describe is the documented and expected behaviour of the
TIMESTAMP column type, so I assume that creationdate is of this type
(i.e. you should have quoted your table structure, too ;-).
TIMESTAMP has a magic behaviour. Read the according manual section for
more info about this. If you don't want the magic behaviour, use
DATETIME instead.
Bye,
Benjamin.
On Sun, Apr 02, 2000 at 06:53:22PM -0400, you wrote
I am attempting to update a field with the current date and time. After the
update has taken place, another field is also updated with the exact same
information. This is totally unexpected.
[...]
* Both fields above indicate different dates and times. Now, I'm
attempting to set
just the lastlogindate to the current time.
mysql> update user set lastlogindate=now() where keyno='00000000710902292449'
\g
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
* After the update, I check the value of both fields.
mysql> select creationdate,lastlogindate from user where
keyno='00000000710902292449' \g
+----------------+----------------+
| creationdate | lastlogindate |
+----------------+----------------+
| 20000402183157 | 20000402183157 |
+----------------+----------------+
1 row in set (0.00 sec)
* Why did the field creationdate also get update eventhough it wasn't explicity
told
to do so?
[...]