Database Error: Exception executing query: 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 '-24' at line 12

Query: SELECT DISTINCT a.product_id FROM store_product_popularity a JOIN store_db_data b ON a.product_id = b.table_id AND b.tablerefs_id = 1 JOIN store_products c ON a.product_id = c.id JOIN store_products_catmap d ON a.product_id = d.product_id JOIN store_categories_nested parent ON parent.catid = '9' JOIN store_categories_nested child ON child.lft BETWEEN parent.lft AND parent.rgt WHERE b.option_id = '73' AND c.status = 1 AND d.catid = child.catid ORDER BY a.trending_score DESC LIMIT 24 OFFSET -24

MySQL Error: 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 '-24' at line 12 (1064)

Database Error: next_record called with no query pending.

MySQL Error: 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 '-24' at line 12 (1064)

Tobacco: