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.*, top_ten.id as ttid from products inner join top_ten on (top_ten.product_table_id=products.id) WHERE products.hidden='0' ORDER BY top_ten.weight ASC LIMIT -100, 100