Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.