From: "Hihn Jason" <[EMAIL PROTECTED]>

> I have a table whose schema contains:
> id INTEGER AUTO_INCREMENT,
> gen_time TIMESTAMP,
> rec_time TIMESTAMP,
> repeats INTEGER DEFAULT 0,
> PRIMARY KEY (id),
> INDEX (rec_time))
>
> When I do an:
> UPDATE table SET repeats=repeats+1
>
> gen_time gets updated as well:
> mysql> select id, gen_time, rec_time, repeats from table;
> +----+----------------+----------------+---------+
> | id | gen_time       | rec_time       | repeats |
> +----+----------------+----------------+---------+
> |  1 | 20020404164500 | 20020405111308 |       0 |
> +----+----------------+----------------+---------+
> 1 row in set (0.01 sec)


This is a MySQL feature -- the first TIMESTAMP type column in a row will be
updated automatically when anything else in that row is updated.


--
denonymous
www.coldcircuit.net



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to