is deze zoekopdracht wat u zoekt?
$query =<<<MYSQL
SELECT `prod_id`
FROM `produdct_category`
INNER JOIN `category` ON `product_category`.`cat_id` = `category`.`id`
WHERE `category`.`parent_id` = {$selectedParentId}
MYSQL;
Bijgewerkte vraag, bijgewerkt antwoord:
$query =<<<MYSQL
SELECT *
FROM `produdcts`
INNER JOIN `produdct_category` ON `products`.`prod_id` = `produdct_category`.`prod_id`
INNER JOIN `category` ON `product_category`.`cat_id` = `category`.`id`
WHERE `category`.`id` = {$selectedCatId}
OR `category`.`parent_id` = {$selectedCatId}
MYSQL;