I'm passing $this->data to the save() function. The controller is the default made by "cake bake" which includes the following in the add() function:
function add() { if (!empty ($this->data)) { $this->Status->create(); if ($this->Status->save($this->data)) { ... If I take a field param out of the $this->data array, will it be excluded from the insert or update? 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 -~----------~----~----~----~------~----~------~--~---