Hello,
ich have Problems to save data in a hasMany/belonsto
Users_ProfilesTable.
Sie Array is OK.
My source:
View User:
<?php // echo $html->hidden('User/user_id', array('value' =>
$post['User']['id']));?>
post to User/Controller save the data and post user_id to Profile/
controller
View/Profile
echo $form->hidden('User/user_id', array('value'=> $userid));
Controller/Profile
function addprofile($userid=0) {
$this->set('userid',$userid);
if (!empty ($this->data)) { #Formular wurde
abgeschickt->eingegebene Datenspeichern
$this->cleanUpFields();
$this->Profile->create();
$this->data['Profile']['user_id']=array($this->data['User']
['user_id']);
$this->Profile->save($this->data);
$this->data['User']['profile_id']=array($this->Profile-
>getLastInsertId());
//error_log(print_r($this->data,true));
$this->Session->setFlash('The Profile-Data has been
saved');
exit();
}
Have somebody an idea?
Sincerely Kathrin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---