h1

Why ‘created’ and ‘modified’ fields might not save

May 28, 2007

https://trac.cakephp.org/ticket/2595

I found this when I was searching for a reason that the created and modified fields were not automagically saving when I saved a record to the database.

What is says is that instead of defining the created and modified fields as NOT NULL, they should be defined as NULL and let Cake then go ahead and put an entry into them. This is for version 1.2

Use
`modified` datetime default NULL,
instead of
`modified` datetime default NOT NULL default '0000-00-00 00:00:00',

Advertisements

One comment

  1. Nice tutorial….thanks for this post…..
    Please visit this link for learn more script.
    http://amitmondal.wordpress.com/



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: