To save a single field, use $this->User->saveField($name, $value, $validate)
To save more than one field but not all, specify them in your $fieldList array: $this->User->save($data, $validate, $fieldList) Cake API is your best friend ;) http://api.cakephp.org/1.2/class_model.html#ba917bb43f3eef7d1d72e10b87dc4b62 On Jul 7, 4:25 pm, "Jonathan Holloway" <[EMAIL PROTECTED]> wrote: > Hi all, > > This is probably a very basic question but I'm retrieving a user from a > database using the following: > > $user = $this->User->findByEmail($email); > > Then setting a subset of the users details in the update my details form: > > $this->data = $user; > > When this form is resubmitted with the updated details I want to save them > to the database. An important > point here is that I only want to update a subset of the users details. > > If I do: > > $this->User->save($this->data['User']); > > then it only saves the submitted values, the previous values stored there > are erased. Wah. > > Is there an easy way to do this without resorting to copying the values over > one by one. > > Many thanks, > Jon. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---