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 '-50, 50' at line 39 SELECT SQL_CALC_FOUND_ROWS g.id, g.novelty,g.parent_id, g.title, g.price, g.price_new, g.currency_id, g.size,
g.size_x, g.size_y, g.size_z, coinage.value,
(SELECT image_url FROM goods_img WHERE iid=g.id AND is_main=1 LIMIT 1) image_url,
s.price_percent_sign, s.price_percent_value, s.url,
CASE
WHEN g.price_new IS NOT NULL THEN g.price_new*coinage.value
ELSE g.price*coinage.value
END AS curPrice
FROM goods g INNER JOIN sections s
ON s.id=g.parent_id
INNER JOIN coinage
ON coinage.id=g.currency_id
WHERE
g.active=1
AND g.parent_id=957
ORDER BY g.sort_key DESC
LIMIT -50, 50