Also if the models are related you can do
if ($this->Answers->User->save(array('User'=>$userData) {
$user_id =$this->Answers->User->lastInsertId();
$this->params['data']['otherModelData']['userr_id'] = $user_id;
// now do your save of other stuff
not tested or what ever but gives you the idea, you may want to save
yourself the overhead of $this->requestAction....
Sam D
still cranky and still and old fart ;)
On 8/24/06, Pablo Viojo <[EMAIL PROTECTED]> wrote:
> Check the object that "/users/saveUser" is returning, I think it's not only
> an id but a more complex structure.
>
> Regards,
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]
> http://pviojo.net
>
>
>
> On 8/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > hi, here is my problem: i need to get user_id before saving the answers
> > of this user, but after i call $userID =
> > $this->requestAction("/users/saveUser"), i found that the
> next saving
> > action just doesn't work, what shall i do please?
> >
> >
> > my models and controllers:
> >
> http://cakephp.org/pastes/show/8be29a861266efcf9943c3d5180fcf98
> >
> >
> >
> >
> >
> >
> > > >
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---