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 [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
-~----------~----~----~----~------~----~------~--~---