Just to make things clearer, posted my code at:
http://bin.cakephp.org/saved/26686
On Dec 28 2007, 12:50 pm, "Louie Miranda" <[EMAIL PROTECTED]> wrote:
> I have two sql tables:
> 1. auth_users - primary_key: auth_user_id
> 2. profiles - association field: auth_user_id
>
> means of HABTM, belongsTo.
>
> I was able to view and display data on my view.
>
> But, editing and saving is a little different to me. I don't know how to
> proceed.
>
> Here's my edit function..
>
> function edit($id = null) {
>
>
>
> > if (!$id && empty($this->data)) {
> > $this->Session->setFlash('Invalid Profile');
> > $this->redirect(array('action'=>'index'), null, true);
> > }
> > if (!empty($this->data)) {
> > $this->cleanUpFields();
> > if ($this->Profile->save($this->data)) {
> > $this->Session->setFlash('The Profile has been saved');
> > $this->redirect($this->referer());
> > } else {
> > $this->Session->setFlash('The Profile could not be saved.
> > Please, try again.');
> > }
> > }
> > if (empty($this->data)) {
> > $this->data = $this->Profile->read(null, $id);
> > }
> > }
>
> Let say, on user table i have a password field and on the profile name.
>
> How could i save password and name on two different field?
>
> --
> Louie Miranda ([EMAIL PROTECTED])http://www.axishift.com
>
> Security Is A Series Of Well-Defined Steps
> chmod -R 0 / ; and smile :)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---