Hi all,
I got a few lines of codes in a Model in cakePHP 1.26:
function beforeSave() {
$this->data['User']['pswd'] = md5($raw['User']['pswd']);
return true;
} // this beforeSave() works
The code above has been tested and it is working in my database.
Yet, I am not sure if I can understand it well,
so, I re-wrote the code in other way, and it just failed to work then.
function beforeSave() {
$raw=$this->data;
$raw['User']['pswd'] = md5($raw['User']['pswd']);
return true;
} // this beforeSave() failed to work
Why the second method can not work?