$storeDivisions = $this->Store->find('all',
                array('joins' => array(
                                       array('table' => 'divisions',
                                             'alias' => 'd',
                                             'type' => 'left',
                                             'foreignKey' => false,
                                             'conditions'=>
array('Store.division_id = d.division_id')
                                        )
                                 ),
                       'conditions'=>array('d.country_id'=>1),
                       'order'=>array('Store.store_name ASC')
                ));


On Wed, May 19, 2010 at 9:18 AM, Jeremy Burns <jeremybu...@me.com> wrote:

> I would start by reading this part of the online 
> guide<http://book.cakephp.org/view/1000/Models>.
> Setting up models is key to just about everything you do in Cake, so simply
> finding out how to join two tables will only move you on to your next
> problem.
>
>
> Jeremy Burns
> jeremybu...@me.com
>
>
> On 18 May 2010, at 12:29, cakephpBbsr wrote:
>
> Hello Team,
>
> I want to join two tables in controller using find().Can u provide me
> some sample code.
>
> Thanks
> Rasmi
>
> 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+unsubscr...@googlegroups.com 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+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to