php - Magento SQL Query - Filter products by category
I've the following SQL query to retrieve products:
$query = "SELECT *,m.m_name,m.m_website FROM belvg_countdown c INNER JOIN catalog_product_entity e ON e.entity_id=c.entity_id LEFT JOIN manufacturers_products mp ON c.entity_id=mp.product_id LEFT JOIN manufacturers m ON mp.manufacturers_id=m.manufacturers_id WHERE DATE_FORMAT(expire_datetime_off , '%Y-%m-%d') > DATE_FORMAT(NOW() , '%Y-%m-%d') AND DATE_FORMAT(expire_datetime_on , '%Y-%m-%d')!=DATE_FORMAT(NOW() , '%Y-%m-%d') AND entity_type='product'";
Now I'd also add a statement to load only products that are in a category named "featured". Can you please help me to understand what should I compare/query to get only "featured" products?