Hi,

In my app I have 3 2 tables:

Clients
Animations

Clients and Animations are linked via a HABTM association. Slightly
unusually, a client needs to have access to all animations that
haven't been linked to any client (other than themselves).

So far I'm doing:

$this->Animation->execute ("SELECT DISTINCT animations.* from
animations, animations_clients WHERE (animations.id <>
animations_clients.animation_id OR animations_clients.client_id =
'{$this->client_id}') ORDER BY animations.name");

This seems to be getting all records still, even though some are
definitely associated to a client other than the active logged in
client.

Any pointers as to how I can accomplish this.

Thanks,

Jon


-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
 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