I have a date column in my table. When I perform an update query on the rows, each time the date gets refreshed to the current date. I have set date’s default value to CURRENT_TIMESTAMP but why is this happening each time?
UPDATE
My create query:
CREATE TABLE `ACCOUNTS` (
`id` bigint(7) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(30) DEFAULT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` varchar(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1234567 DEFAULT CHARSET=latin1
It’s probably something to do with
datebeing a keyword. try changing it tosome_date. WasCURRENT_TIMESTAMPintentional?