Never mind, It has been solved,
I used the Query() command with this query from Lavin:
SELECT t1.product_id
FROM users_products t1
WHERE t1.user_id=$user1
AND t1.product_id IN
(SELECT t2.product_id
FROM users_products t2
WHERE t2.user_id=$user2)
Thansk!
On 12 jun, 18:17, Céryl <[email protected]> wrote:
> Hej all,
>
> I still can't find a solution to my problem. I have a users that can
> place products on a favorites list. The products have a HABTM relation
> with users. Now I need to find the products that are similar on the
> lists of two users. Is there a handy query for this or do I have fetch
> both list seperate and code PHP that iterates through the arrays and
> checks it. I think coding will become to slow, so I prefer a query
> solution.
>
> Does anybody have any idea to solve this?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---