Reputation: 73
What happen to my code, after uploading to godaddy server it has an error but in localhost their is no error.
public function activate($activation_key='') {
$userData = $this->Users->find('all')->where(['activation_key' => $activation_key,'status' => 0 ])->first();
if( !empty($userData) ){
$activeStatus = 1;
$status = $this->Users->updateAll(array('Users.status' =>
$activeStatus), array('Users.id' => $userData->id));
//// additional code
}
}
stack trace error is on this line
$status = $this->Users->updateAll(array('Users.status' =>
$activeStatus), array('Users.id' => $userData->id));
Needing your help
Upvotes: 1
Views: 57
Reputation: 2968
You syntax is incorrect:
UPDATE `users` SET `Users`.`status`...
Should be:
UPDATE `users` AS `Users` SET `Users`.`status`...
Remove Users
aliases from updateAll
.
Upvotes: 1