which one is the edit function? If it's the second one try with
$this->Client->id = $this->Session->read('client_id'); before saving. On 6/1/07, cake_learner <[EMAIL PROTECTED]> wrote: > > > When i try to update record, its inserting a new record. > > I have a registration page, containing 6 pages. I am inserting the > data in same table. After the first page is saved, the insertid is > retrieved and stored in a session. > > Code: > controller: > > function index() > { > if(!empty($this->data['Client'])){ > $this->Client->save($this->data); > $this->Session->write('client_id', $this->Client- > >id); > $this->redirect('/clients/register2'); > } > > function register2() > { > if(!empty($this->data['Client'])) > { > $client_id=$this->Session->read('client_id'); > $this->cleanupFields(); > $this->Client->save($this->data); > } > } > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---