I suspect that you need more than you are asking for here. But here is a single query that will do what you want I think.
Code:
$result = func_query("
SELECT cats.parentid
FROM $sql_tbl[products] as prods,
$sql_tbl[products_categories] as prod_cats,
$sql_tbl[categories] as cats
WHERE prods.product = '$p[product]' and
cats.productid = prods.productid and
prod_cats.categoryid = cats.categoryid and
prod_cats.parentid = 1
")
if (count($result) == 1) {
$pcatsection = 'dvds';
}
You should probably run the query from phpMyAdmin to make sure it does what you want.
Rick