Using both solutions getting following error.. Cannot insert a value for auto-increment primary key [Profile.ID]
:( On Mon, Aug 31, 2009 at 6:00 PM, Alexandre SALOME < alexandre.sal...@gmail.com> wrote: > 2 solutions : > > - check the id field is set and be sure it is rendered in form (hidden > field : $form->renderHiddenFields()) > - Add id to parameters : $this->form->bind(array_merge(array('id' => $id), > $request->getParameter($this->form->getName()))); > > Good luck > > > > 2009/8/31 krishan <milepe...@gmail.com> > >> >> Friends I am facing a problem for updating a record in table in many >> steps. >> In each step I save the submitted data. >> >> This is my code >> >> $this->form = new ProfileForm(); >> $this->form->bind($request->getParameter($this->form->getName())); >> >> if ($this->form->isValid()) { >> $this->form->setOption('id', $request->getParameter('id')); >> $php_profile = $this->form->save(); >> } >> >> when I run $this->form->save(); function it adds a new record in >> database. But I want it to update the record provided with the id. >> Does anyone knows how to do that. I tried o use $this->form->setNew >> (false); but does not work with $this object... >> >> > > > -- > Alexandre Salomé -- alexandre.sal...@gmail.com > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---