SELECT * FROM product a , product_image b , available_prod_size c WHERE a.id = b.product_id and a.id = c.prod_id AND a.cat_id =41 or a.cat_id =34 or a.cat_id =35 or a.cat_id =36 or a.cat_id =39 or a.cat_id =45 AND b.act = '1' AND a.act = '1' AND b.front = '1'