i faced a problem while update my profile.

function edit($id){
        if (empty($this->data)) {
                $this->product->id = $id;
        $this->data = $this->product->read();
        }else{

                if($this->product->save($this->data['product'])){
                        $this->Session->setFlash('Updated Sucessfully');
                        $this->redirect('/product/account_settings');

                }else{
                        $this->Session->setFlash('Please correct the errors');
                }
        }

  }

i use the above code for update, but it will insert my data in a new
row in database.

i passed my product id through hidden variable.


my need is to edit my profile from database and update.

anybody help me in this regard.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to