While this works fine, and makes your app more secure... the real
question is why are you passing fields that do not need saving to the
controller? or why do you even have them in the form?


On Oct 7, 7:50 pm, "R. Davila" <[EMAIL PROTECTED]> wrote:
> The answer was to pass an array of field names to save().
>
>         save($this->data, true, array('field_a', 'field_b'));
>
> That way field_c is excluded from the save.
>
> Thanks!
>
> teknoid wrote:
> > Is the field in the data array?
> > Cake also has a white list of fields param you can (and should) pass
> > to save().
>
> > On Oct 7, 7:00 pm, "R. Davila" <[EMAIL PROTECTED]> wrote:
> >> Hi,
> >> I have a table with a timestamp field which is managed by MySQL.
> >> This is the definition of the field:
> >>     `fieldname` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
> >> CURRENT_TIMESTAMP
> >> When a new record is inserted, MySQL fills in the default value for the 
> >> field.
> >> When the record is updated, MySQL updates the field value accordingly.
> >> I need to tell CakePHPnot to include that fieldin the inserts and updates, 
> >> otherwise MySQL does not assign the values it should.
> >> The timestamp field is just an example since the behavior I'm looking for 
> >> would be needed for any computed field in the table.
> >> Thanks in advance
>
> > ------------------------------------------------------------------------
>
> > No virus found in this incoming message.
> > Checked by AVG -http://www.avg.com
> > Version: 8.0.173 / Virus Database: 270.7.6/1713 - Release Date: 10/7/2008 
> > 6:40 PM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to