Change the field name to "created" and add another named, "modified". Both of them should be defined like so:
DATETIME DEFAULT NULL Cake will then set the value when/where appropriate. On Sun, Apr 12, 2009 at 2:05 AM, gaurav.v.sharma <[email protected]> wrote: > > Hi all :-), > > I have created a small application using the bake command. While > designing the database for the application I created a column named > "creationdate" in every table so as to record the date and time of > that operation. > > I donot allow user to enter this "creationdate" value infact I have > created the column attribute as "on Update set current timestamp" and > the datatype as timestamp. This is handled by mysql itself and the > creationdate is automatically filled with current date and time > whenever an insert operation is performed on the table. > > Earlier (when I was not using cakephp framework) these values were > updated automatically but now that I have started using cakephp these > values are going as null in the database. > > What should I do when I want to update the "creationdate" column > automatically whenever an insert/update operation is performed. > > I am using XAMPP v 1.7.0 which is having following version of > apache,mysql and php > * Apache HTTPD 2.2.11 > * MySQL 5.1.30 > * PHP 5.2.8 > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
