Sunday, July 25, 2010

Re: Notice (8): Undefined index: firstname [APP\controllers\users_controller.php, line 45]

On Sun, Jul 25, 2010 at 1:44 PM, Tomfox Wiranata
<tomfox.wiranata@gmail.com> wrote:
> hey cricket, thx. it makes sense. but if i code
>
>        if (!empty($this->data))
>        {
>
>                if ($this->User->save($this->data))
>                        {
>                                $this->Session->setFlash('Profil aktualisiert');
>                                $this->redirect(array('controller' => 'users', 'action' =>
> 'profile'));
>                        }
>                        else{
>                                $this->Session->setFlash('Speichern fehlgeschlagen');
>                                $this->redirect(array('controller' => 'users', 'action' =>
> 'editprofile'));
>                        }
>        }
>
> cake inserts a complete new data in my table and does not update the
> on that is edited. the error occurs not though :)

You have to include a hidden form element with the record ID. See this
page in the tutorial:

http://book.cakephp.org/view/340/Editing-Posts

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: