Jump to content

ON UPDATE


The Little Guy

Recommended Posts

I have been having all kinds of trouble with this script, and here is the last thing I need YEY!

 

I have one field that is "Supposed" to update the date when the row is updated, why doesn't it work?

 

its a "timestamp"

its attribute is: "ON UPDATE CURRENT_TIMESTAMP"

default value: "0000-00-00 00:00:00"

Link to comment
https://forums.phpfreaks.com/topic/141150-on-update/
Share on other sites

CREATE TABLE IF NOT EXISTS `projects` (
  `id` bigint(20) NOT NULL auto_increment,
  `owner_id` bigint(20) NOT NULL,
  `url` varchar(255) NOT NULL,
  `title` varchar(100) NOT NULL,
  `comment` varchar(2000) NOT NULL,
  `counter` bigint(20) NOT NULL,
  `date` varchar(20) NOT NULL,
  `projectCode` varchar(10) NOT NULL,
  `public` enum('yes','no') NOT NULL default 'yes',
  `visitors` bigint(20) default NULL,
  `views` bigint(20) default NULL,
  `updated` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

Link to comment
https://forums.phpfreaks.com/topic/141150-on-update/#findComment-738823
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.