SELECT i.`id` item_id, i.`name`, i.`descr`, i.`flag`, i.`kind`, t.`id` as `tree_id`,t.cleft,t.cright, t.`parent_id`,i.satellitdescr FROM `tree` t JOIN `items` i ON i.`id` = t.`link_id` WHERE t.`cleft` BETWEEN 1434 AND 1475 AND t.kind = 'good' AND t.clevel = 6 AND NOT (i.`flag` & 1) ORDER BY t.`cleft` LIMIT -20, 20;
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 '-20, 20' at line 2