Database error: Invalid SQL: SELECT t.idx, t.icon, t.image, t.photo, t.style, t.name, t.type_name, t.name_en, t.type_name_en, t.title, t.title_en, t.url, t.type_url, t.url_en, t.type_url_en, t.pageurl, t.pageurl_en, SUM(t.cnt) AS qty, MIN(NULLIF(t.mpr, 0)) AS minprice, MAX(NULLIF(t.maxpr, 0)) AS maxprice, ISNULL(MIN(NULLIF(t.mpr, 0))) AS isn FROM ( (SELECT trt_tour_types.id AS idx, trt_tour_types.icon, trt_tour_types.image, trt_tour_types.photo, trt_tour_types.style, trt_tour_types.name, trt_tour_types.name_en, trt_tour_types.name AS type_name, trt_tour_types.name_en AS type_name_en, trt_tour_types.title, trt_tour_types.title_en, trt_tour_types.url, trt_tour_types.url_en, trt_tour_types.url AS type_url, trt_tour_types.url_en AS type_url_en, trt_tour_types.pageurl, trt_tour_types.pageurl_en, trt_tour_types.order_on_page, COUNT(DISTINCT trt_tours.hotel_id) AS cnt, ROUND(MIN(trt_tours.price1*28.8700+trt_tours.price2*1.0000+trt_tours.price3*34.6500)/1.0000) AS mpr, 0 AS maxpr FROM trt_tour_types, trt_tours LEFT JOIN trt_tours_dates ON trt_tours.id = trt_tours_dates.tour_id WHERE trt_tour_types.id=trt_tours.tour_type_id AND trt_tours.active=1 GROUP BY idx ORDER BY order_on_page ASC) UNION (SELECT trt_tour_types.id AS idx, trt_tour_types.icon, trt_tour_types.image, trt_tour_types.photo, trt_tour_types.style, trt_tour_types.name, trt_tour_types.name_en, trt_tour_types.name AS type_name, trt_tour_types.name_en AS type_name_en, trt_tour_types.title, trt_tour_types.title_en, trt_tour_types.url, trt_tour_types.url_en, trt_tour_types.url AS type_url, trt_tour_types.url_en AS type_url_en, trt_tour_types.pageurl, trt_tour_types.pageurl_en, trt_tour_types.order_on_page, COUNT(DISTINCT trt_progtours.id) AS cnt, ROUND(MIN(trt_progtours.price1*28.8700+trt_progtours.price2*1.0000+trt_progtours.price3*34.6500)/1.0000) AS mpr, 0 AS maxpr FROM trt_tour_types, trt_progtours LEFT JOIN trt_progtours_dates ON trt_progtours.id=trt_progtours_dates.tour_id, trt_progtours_locations WHERE trt_tour_types.id=trt_progtours.tour_type_id AND trt_progtours.id=trt_progtours_locations.tour_id AND trt_progtours.active = 1 GROUP BY idx ORDER BY order_on_page ASC) UNION (SELECT trt_tour_types.id AS idx, trt_tour_types.icon, trt_tour_types.image, trt_tour_types.photo, trt_tour_types.style, trt_tour_types.name, trt_tour_types.name_en, trt_tour_types.name AS type_name, trt_tour_types.name_en AS type_name_en, trt_tour_types.title, trt_tour_types.title_en, trt_tour_types.url, trt_tour_types.url_en, trt_tour_types.url AS type_url, trt_tour_types.url_en AS type_url_en, trt_tour_types.pageurl, trt_tour_types.pageurl_en, trt_tour_types.order_on_page, 0 AS cnt, 0 AS mpr, 0 AS maxpr FROM trt_tour_types WHERE trt_tour_types.active=1 GROUP BY idx ORDER BY order_on_page ASC) ORDER BY order_on_page ASC ) AS t GROUP BY idx ORDER BY order_on_page ASC
MySQL Error: 2006 (MySQL server has gone away)
Session halted.