hello John
thanks for the reply but its showing an error

Notice (8): Undefined property:  AppModel::$User [APP/controllers/
users_controller.php, line 3493]

Fatal error: Call to a member function find() on a non-object in /var/
www/Forex24/app/controllers/users_controller.php on line 3493

associations are defined . so can i bind the model in controller only.

thanks

On Jan 13, 8:44 pm, John Andersen <[email protected]> wrote:
> I assume that you have defined the following associations/
> relationships in your models:
> Detail belongsTo User / User hasMany Details
>
> If you have the Detail record, then you can make the following query
> from the Detail controller side:
> [code]
> $this->Detail->User->find(
>    'all', array(
>       'recursive' => 1,
>       'conditions' => array(
>          'User.id' => $this->data['Detail']['user_id']
>       )
>    )
> );
> [/code]
>
> Enjoy,
>    John
>
> On Jan 13, 9:51 am, Manu <[email protected]> wrote:
>
>
>
> > I have two tables details and users . I am getting the Detail.id from
> > this i will be able to know User.id and then from users table i have
> > to fetch user data like(name, email, etc). so i want to make query in
> > cake pattern that in result should give me data of both the table.
> > Here's simple query that i have made but couldnt get it going in cake
> > pattern.
>
> > SELECT d.vps_name, d.machine_type, d.ipAddress, d.rdp_user,d.rdp_pass,
> > d.dc_user, d.dc_pass, d.status, d.user_id, d.order_id,u.email,
> > u.fname, u.lname         FROM details as d
> > LEFT JOIN users as u
> > ON d.user_id = u.id
> > WHERE d.user_id = u.id
>
> > Thanks in advance
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 [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

Reply via email to