Rtanz

1. I don't see a "Role" model in your posted code.

2. You appear to be trying to query the Membership table from the Task 
model - $this->Task->findAll(...);

I would strongly recommend that you go back to the manual and read up on 
find, findAll, findById.

You are making this query far more complex than it needs to be.

All you should have to do is a findById on Membership supplying the id 
as an argument.  Try this out.  Get the basics working, then try more 
complex things.

Langdon



rtanz wrote:
> pasted everything here
> 
> http://bin.cakephp.org/view/1386155143
> 
> includeing query generated and models concerned
> 
> On Aug 15, 9:05 am, Langdon Stevenson <[EMAIL PROTECTED]>
> wrote:
>> No idea really, not without seeing all three models and the query that
>> is being generated.
>>
>> Regards,
>> Langdon
>>
>> rtanz wrote:
>>> thnx langdon, i took that relationship out however the query is still
>>> returning 0 results. I am using recursive 3 so it should be able to
>>> retrieve two levels down. any other ideas why this is not working? tnx
>>> On Aug 15, 1:47 am, Langdon Stevenson <[EMAIL PROTECTED]>
>>> wrote:
>>>> 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