I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year.
On 22 mai, 07:47, Stephen Orr <[EMAIL PROTECTED]> wrote: > I believe I used this method: > > 'last_login' => '!-NOW()' > > Which makes Cake stop trying to quote it. But I'm pretty sure the > latest SVN revision recognises NOW() and doesn't quote it anyway. > Maybe I'm confused. > > Steve > > On May 22, 2:12 am, Alex Ciobanu <[EMAIL PROTECTED]> wrote: > > > Zifnab wrote: > > > I'm trying to figure out how to implicitly make a mysql NOW() call > > > when doing a model save...here's an example of the code: > > > > $aUserData = array( > > > 'User' => array( > > > 'id' => 4, > > > 'last_login' => 'NOW()' > > > ) > > > ); > > > > $this->User->save( $aUserData, false, array( 'last_login' ) ); > > > > Naturally the save doesn't work, because NOW() saves as a string > > > "NOW()" instead of as a mysql function NOW()....How do I get it to > > > save as a mysql function? > > > $aUserData['User']['last_login'] = date("Y-m-d H:i:s"); > > $this->User->save($aUserData); > > > Not using NOW(), but does the trick. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---