I'm trying to update a field in my DB but I'm having a hard time to
get it to work.
here is the code:
function confirm($newUserId = null, $code = null) {
$user = $this->User->find('first', array(
'conditions' => array('User.id' => $newUserId),
'recursive' => '0',
'fields' => array('User.confirm_code',)
));
if($user['User']['confirm_code'] == $code) {
$this->User->id = $newUserId;
$this->User->saveField('confirmed', '1');
$this->Session->setFlash('it works...');
}
else {
$this->Session->setFlash('nope...');
}
}
I'm getting the "it works..." message but no db query so the "confirm"
field is still 0 in the DB...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---