SQL ERROR: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
select distinct p.products_image, p.products_model, pd.products_name,
p.products_id,p.products_quantity,
p.products_image,products_image_med , p.products_price,
p.products_tax_class_id,
if(s.status, if(isnull(pg.customers_group_price), least(s.specials_new_products_price, p.products_price), least(pg.customers_group_price, s.specials_new_products_price)), if(isnull(pg.customers_group_price), p.products_price, least(pg.customers_group_price, p.products_price))) as final_price from products p left join specials s on (p.products_id = s.products_id )
left join products_groups pg on (p.products_id = pg.products_id)
left join products_description pd on (p.products_id = pd.products_id )
left join products_to_categories pc on (p.products_id = pc.products_id )
left join categories_description cd on (cd.categories_id = pc.categories_id )
left join manufacturers m on (p.manufacturers_id = m.manufacturers_id )
where p.products_status = '1'
and pd.language_id = '1'
and p.products_stock_type not in (9)
and p.products_group_access like '%g%'
and p.manufacturers_id = 346 and products_parent_id = 0 and pc.categories_id in (618,726,954,938,867,946,879,624,722,626) group by p.products_family_name order by p.products_id desc limit 0, 52