Does anybody know how i can get all results based on more then one
item with a HABTM relation. for example i have:
$this->set('articles', $this->Category->findBySlug(array('php',
'photoshop')));
But i will only get the articles from the first category:
This is the query it will make:
SELECT `Category`.`id`, `Category`.`name`, `Category`.`slug`,
`Category`.`parent_id`, `Category`.`lft`, `Category`.`rght`
FROM `scms_categories` AS `Category`
WHERE `Category`.`slug` IN ('tutorials', 'photoshop')
LIMIT 1 1 1 1
SELECT `Article`.`id`, `Article`.`title`, `Article`.`slug`,
`Article`.`article`, `Article`.`published`, `Article`.`viewed`,
`Article`.`user_id`, `Article`.`created`, `Article`.`modified`,
`ArticlesCategory`.`article_id`, `ArticlesCategory`.`category_id`
FROM `scms_articles` AS `Article`
JOIN `scms_articles_categories` AS `ArticlesCategory` ON
(`ArticlesCategory`.`category_id` IN (1) AND
`ArticlesCategory`.`article_id` = `Article`.`id`)
ORDER BY `Article`.`id` DESC
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---