In Cake, or I guess in SQL rather, you need to tell the system which record 
you want to update.

You are passing in data, with no primary key value specified. So, one way 
to do this, would be:

$setting = $this->User->Setting->findByUserId($user_id);
if(!empty($setting)){
  $setting['Setting']['prefered_language'] = $lang;
  $this->User->Setting->save($setting);
}

This is how I normally do it.
The point is, you must communicate the PrimaryKey value to cake somehow.
Even in SQL you have to specify the UPDATE ... WHERE (some_key = 
some_value) right?

Happy Coding.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to