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,10' at line 1
SELECT * FROM `documents` WHERE `language`="0" AND `category_id`="1" AND `active`=1 AND `download_hash` != '' AND `download_hash` is not null AND `filename` != '' AND `filename` is not null ORDER BY `sort` ASC LIMIT -10,10