On Oct 30, 9:50 am, SERKAN TURAN <[email protected]> wrote:
> Hi,
> I have an query and I could not figure it out what is the cakephp form of
> it.
>
> query:
> -------------------------------------------
> SELECT *
> FROM
>   tags`
>   INNER JOIN `tags_articles` ON (`tags`.`id` = `tags_articles`.`tag_id`)
>   INNER JOIN `articles` ON (`tags_articles`.`article_id` = `articles`.`id`)
> WHERE
>   `articles`.`isRead` = 'Not' AND
>   `tags`.`id` = 3 AND
>   `articles`.`status` = 'New'
> ORDER BY
>   `articles`.`name` DESC
> --------------------------------------------------------------------------- 
> -------------------

Serkan,

Your question is almost the same as the example in the book.

See "It's also possible to create an exotic association for the
purpose of creating as many joins as necessary to allow filtering, for
example:"
http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM

have a go and post a follow up if you do not succeed. Tip: search from
Article, not Tag.

AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to