SELECT cp.id, cp.group_id, cp.name as `title`, cp.cod, cp.url_name, cp.price, cp.price_old, IF((SELECT MAX(p.availability) FROM pricelist_loaded p WHERE p.good=cp.id)>0, 1, -1) as `exists` FROM goods cp WHERE cp.public=1 AND cp.action=1 AND (0 < (SELECT `__b`.`public` FROM `brands` as `__b` WHERE `__b`.`id`=`cp`.`brand_id` LIMIT 1)) ORDER BY cp.id DESC LIMIT -12,12
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-12,12' at line 1