If you set up properly the model associations, and set the recursive
value of the $this->EventDeadline object to the number of associations
you have,
you can do :

$this->EventDeadline->find('all', array(
      'conditions'=>array('User.id'=>$user['User']['id']),
      'order'=>'EventDeadline.due_start_date'));

anyway, when you got sql errors, set debug mode to 2  in core.php so
you can see at the bottom of each page the queries.. and you can
better understand what's happening.



On Jan 16, 11:34 am, overture <[email protected]> wrote:
> I'm having real problems when performing finds in CakePHP.  I can't
> seem to get my head around it.  Here's my problem.
>
> Association Structure
> "users"--"users_pay_groups"--"pay_groups"--"event_deadlines"
>
> How do I get all event_deadlines for a given user and order by a field
> in event_deadlines ?
>
> If I do:
> $this->EventDeadline->PayGroup->User->find('all', array(
>       'conditions'=>array('User.id'=>$user['User']['id']),
>       'order'=>'EventDeadline.due_start_date'));
>
> I get an error:
> SQL Error: 1054: Unknown column 'EventDeadline.due_start_date' in
> 'order clause'
>
> Anyone got any ideas?
>
> Thanks! Phil
--~--~---------~--~----~------------~-------~--~----~
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