If you name your fields 'modified' and 'created' and do your edit/ creates with Models, Cake is smart enough to keep those times stamps automatically updated for you.
On Apr 25, 5:41 pm, zach <[EMAIL PROTECTED]> wrote: > I have a MySQL table with two timestamp fields. modified_time and > created_time > > The first, modified_time defaults to CURRENT_TIMESTAMP. > > The 2nd, no matter what I try to insert in there using Cake, gets set > to 0000-00-00 00:00:00 > > The funny thing is that if I use the exact query that Cake Debugger is > telling me it's trying, it inserts a valid timestamp. > > For example... > > Cake says: > INSERT INTO `leads` (`lead_type_id`,`created_time`) VALUES > (1,'2007-04-25 16:32:41') > > The result: > modified_time created_time > 2007-04-25 16:32:41 0000-00-00 00:00:00 > > Notice that modified_time is correctly set to 2007-04-25 16:32:41, but > created_time is set to 0's. > > If I do the same query directly from MySQL: > INSERT INTO `leads` (`lead_type_id`,`created_time`) VALUES > (1,'2007-04-25 16:32:41') > > I get the correct result: > modified_time created_time > 2007-04-25 16:40:01 2007-04-25 16:32:41 > > Thoughts? > > Thanks! > -Zach --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
