SQL ERROR FOUND in SELECT SQL_CALC_FOUND_ROWS r.id AS rid, r.link_attributes, rp.record, rp.title, rp.text, ri.code, ri.price AS default_price, ri.sale_from, ri.top, ri.bazaar, CASE WHEN dd.discount THEN ri.price - (ri.price / 100 * dd.discount) ELSE ri.price END AS price, v.value AS vat, fi.img AS thumb, av_1.value AS producer, dd.discount FROM records AS r JOIN records_pages AS rp ON rp.parent = r.id JOIN records_items AS ri ON ri.parent = r.id JOIN shop_vats AS v ON v.id = ri.vat LEFT JOIN files_images AS fi ON fi.id = rp.thumb LEFT JOIN items_parameters AS ip_1 ON ip_1.parent_id = r.id AND ip_1.attribute_id = 1 LEFT JOIN attributes_values AS av_1 ON av_1.id = ip_1.value_id LEFT JOIN dealers_discounts AS dd ON dd.class_id = 0 AND dd.group_id = av_1.id JOIN catalog_items AS ci ON ci.record_id = r.id AND ci.category_id IN (22412,54356,54359,54371,54372,54373,54453,54529,54552,54604,54657,54684,54713,54756,54805,54865,54875,54880,54922,54957,55005,55058,55095,55108,55132,55152,55162,55183,55200,55218,55259,55296,55327,55357,55363,55392,55430,55460,55490,55528,55538,55547,55553,55572) WHERE r.type = 3 AND r.cms_hidden = "0" AND r.cms_readable = "1" AND rp.visible = "1" AND r.default_lang = rp.lang AND r.default_lang = ri.lang ORDER BY rp.title ASC LIMIT 48 OFFSET 192 [nativecode=2006 ** MySQL server has gone away]