On 7/7/07, francky06l <[EMAIL PROTECTED]> wrote: > > > Actually only the fields that are in this->data will be saved. To > limit the update you have 2 ways : > > 1) if you do not need to show/edit certains fields in the form, just > read what you need for the form using an array of field names. > 2) before saving the data, use unset($this->data['Model']['field']) to > avoid saving a field
There is a 3rd way: $this->save( $this->data, true, $arrayWithFieldList ); By passing the $arrayWithFieldList, it tells the save function to only save values for those fields (this helps avoid situations where a user might insert hidden fields into the HTML before submitting and causing issues (like, perhaps, inserting the id field as a hidden field causing it to update somebody else's record)) Hope this helps. - Gonzalo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
