I am currently trying to run a productCollection to try and get a list of products that are not assigned to one or more categories.
$collection = Mage::getResourceModel('catalog/product_collection');
$catId = [46]; // category id to exclude
$collection->getSelect()->join(array('cats' => 'catalog_category_product'), 'cats.product_id = e.entity_id'); // Join with category on product/entity id
$collection->getSelect()->where('cats.category_id', array('nin' => array('finset' => $catId))); // exclude category from collection
echo '<pre>';
echo $collection->getSelect(); // See sql query
print_r($collection->getData());
This is what I currently have however it doesn't exclude the fact that these products may be in a child category of the id provided.
Any help would be greatly appreciated,