I don't think
AND product_extra_categories.category_id = categories.id
is necessary, but don't think it hurts anything either.
WHERE products.id = categories.product_id
Something like this (you don't give us the column names so I guess):
p.product_id = c.product_id and
p.product_id = e.product_id