SELECT V.id,V.product_id,V.productnumber, V.quantity, V.unlimited, P.saleprice,P.price,P.discount_percent,P.discount_from,P.discount_till, P.is_black_friday, P.is_pre_bait, P.black_friday_price,if(P.onsale=1 && (P.discount_from IS NULL || (P.discount_from<=NOW() && P.discount_till>=NOW())),true,false) as onsale,if(P.onsale=1 && (P.discount_from IS NULL || (P.discount_from<=NOW() && P.discount_till>=NOW())),P.saleprice,P.price) as theprice FROM sc_ws_products_variant V LEFT JOIN sc_ws_products_price P ON P.product_variant_id = V.id AND P.usergroup_id = :customergroup WHERE 1 ORDER BY V.product_id, theprice
Error!: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away