Hey,
I'm so happy I've found this group. Maybe someone can help me with my
problems here (I'm a beginner in Cakephp). Sorry for my bad english by
the way.

Ok I've got two Models in HABTM relation: verses and users. in my
controller action i want to get some specific verses (for example: the
first ten verses) and something like a left join to the users table,
so i can see whether the logged in user is assigned to any of them.
BUT i don't want to show any other users and I don't want to have only
the verses the user is assigned to.

This would mean, Someone reads some verses and beside some of them is
a little note "you are assigned to these verses"....(maybe there is an
even easier solution for this?)

In MySQL this Query works perfectly:
SELECT * FROM verses LEFT JOIN (SELECT * FROM users_verses WHERE
user_id = 1) AS user ON verses.id = user.verse_id LIMIT 10

the subquery only searches users_verses for user 1 and in left joining
the verses table some of the ten verses will have the user assigned to
it and some are simply nulled.

how can I get the same effect with cakephp?


THANK YOU so much for you help
Fabian

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