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 (229,230,235,236,237,238,240,12075,12094) 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 10 OFFSET -10 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-10' at line 36]