est-ce que cette requête est ce que vous cherchez ?
$query =<<<MYSQL
SELECT `prod_id`
FROM `produdct_category`
INNER JOIN `category` ON `product_category`.`cat_id` = `category`.`id`
WHERE `category`.`parent_id` = {$selectedParentId}
MYSQL;
Question mise à jour, réponse mise à jour :
$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;