
Originally Posted by
r937
use a UNION if it's OR
use a 5-table join if it's AND
Thanks, very straightforward in the end. Here's my final query:
Code:
SELECT `catalogue`.`id`, `title`
FROM `catalogue`
INNER JOIN `cataloguesections` ON `cataloguesections`.`catalogueid` = `catalogue`.`id`
INNER JOIN `sections` ON `sectionid` = `sections`.`id`
INNER JOIN `cataloguecategories` ON `cataloguecategories`.`catalogueid` = `catalogue`.`id`
INNER JOIN `categories` ON `categoryid` = `categories`.`id`
WHERE `categories`.`id` = x
AND `sections`.`id` = y
M
Bookmarks