Hi rtanz

In your query you don't need to specify the relationship:

  AND Membership.role_id = TaskTemplate.role_id

If you have this relation defined between the Membership, Role, and Task 
models, then Cake will retrieve the related data for you (assuming you 
allow it to retrieve related data two levels down).

Just select the Membership that you want and Cake will do the rest.

If for some reason this produces too many queries for your liking, 
Google the "expects()" function to help unbind unneeded models, or as a 
last resort run the query from MySQL using $this->ModelName->query();

Regards,
Langdon


rtanz wrote:
> hi i am having problems obtaining results for a query through cakephp,
> i posted the relevant code in this link
> http://bin.cakephp.org/view/1874003220
> 
> note that the first part is the query as constructed through the mysql
> query builder which correctly returns the results, while the second
> part is what i did through cake, which is not returning any results.
> 
> thanks for any help

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to