0
votes

I am facing a issue during update query.

MODEL CODE

public function resetpassword($key,$password)
{
$aresetpassword = $this->updateAll(array('Register.password'=>$password), array('Register.key'=>$key)); 
return($aresetpassword);
}

VIEW PAGE ERROR

Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column '8815061c1a6c63398b9a2dfb1f44aae89dd59bfd' in 'field list'

SQL Query:

UPDATE `milgyonu_mber`.`registers` AS `Register` 
SET `Register`.`password` = 8815061c1a6c63398b9a2dfb1f44aae89dd59bfd 
WHERE `Register`.`key` = '656abe3991a51c62e860b8d1401e4f49'

Event password field is exists in my table.

1

1 Answers

6
votes

As stated in the manual when using Model::updateAll() you need to manually quote literals in $fields argument. So use array('Register.password'=> '"' . $password . '"')