Saeven
January 5th, 2004, 05:17 PM
Hello,
Consider this table:
CREATE TABLE table_1 (
ID int(8) unsigned NOT NULL auto_increment,
date timestamp(8) NOT NULL,
anniversary timestamp(8) NOT NULL,
PRIMARY KEY (BID)
) TYPE=MyISAM;
With this entry:
198 | 20030328 | 20030105
Where I run this query:
UPDATE table_1 SET anniversary = DATE_ADD( anniversary, INTERVAL 12 MONTH ) WHERE BID = 198;
I'd expect this result:
198 | 20030328 | 20040105
But instead I get:
198 | 20040105 | 20050105
Notice the date column was updated as well as anniversary to today's date where I hadn't specified its alteration anywhere. Why is this? What can I do to avoid this?
Thanks.
Alex
Consider this table:
CREATE TABLE table_1 (
ID int(8) unsigned NOT NULL auto_increment,
date timestamp(8) NOT NULL,
anniversary timestamp(8) NOT NULL,
PRIMARY KEY (BID)
) TYPE=MyISAM;
With this entry:
198 | 20030328 | 20030105
Where I run this query:
UPDATE table_1 SET anniversary = DATE_ADD( anniversary, INTERVAL 12 MONTH ) WHERE BID = 198;
I'd expect this result:
198 | 20030328 | 20040105
But instead I get:
198 | 20040105 | 20050105
Notice the date column was updated as well as anniversary to today's date where I hadn't specified its alteration anywhere. Why is this? What can I do to avoid this?
Thanks.
Alex