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 '-100, 100' at line 1
query=SELECT products.*, min(products_atts.price) as pricefrom, min(products_atts.pricex) as pricexfrom, count(products_atts.product_id) as attcount, products_images.filename as thefile from prodcat_weight inner join products on products.prod_id=prodcat_weight.prod_id left join products_atts on products.id=products_atts.product_id left join products_images on products.prod_id=products_images.prod_id and products_images.firstimg=1 WHERE prodcat_weight.cat_id in (1102,1119,1104,1134,1107,1110,1160,1123,1135,1121,1112,1111,1126,1105,1130,1114,1113,1115,1106,1127,1146,1136,1144,1122,1117,1138,1120,1108,1137,1103,1139,1118,1109,1151) and prodcat_weight.hidden='0' group by products.id order by products.id desc LIMIT -100, 100