Tuesday, September 28, 2010

Re: Join returns 2 arrays - how can I change that?

oh didn't think of that. Thank you! I am not so used with working
arrays. Thanks!

On Sep 28, 3:28 pm, Tilen Majerle <tilen.maje...@gmail.com> wrote:
> did u try this?....
>
> $groups = array_merge($groups["usergroups"], $groups["user"]); // but if u
> have same key's aka id field is in users and usergrups table....it will be
> merged (replaced);
>
> --
> Tilen Majerlehttp://majerle.eu
>
> 2010/9/27 quas <pantyhos...@googlemail.com>
>
>
>
> > Hi there,
>
> > I have a problem with the returning data of my database when I use
> > cakephp.
>
> > when I make a join with 2 tables I get as returnvalue 2 arrays. One
> > for each table...
>
> > for example
> > join: user & usergroup
>
> > results in
>
> > array[user] and array[usergroup]
>
> > I am not sure if this is the normal cakephp behaviour or if I make an
> > mistake
> > but it's a little annoying to use:
>
> >        <?php echo($groups['usergroup']['title'])?>
> >        <?php echo($groups['user']['username'])?>
>
> > in my view.
>
> > How can I achieve that I only get one array back with the joined data
> > so that I can use :
>
> > <? echo $groups['title'] ?>
> > <? echo $groups['username'] ?>
>
> > Thanks a Lot
>
> > Quas
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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<cake-php%2Bunsubscribe@googlegroups.c om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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: