A Database Error Occurred

Error Number: 1064

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 '-40, 40' at line 31

SELECT wp.id wp_id, wp.order_code wp_order_code, wp.thumb_link wp_thumb_link, wp.price wp_price, wp.price_action wp_price_action, wp.in_store wp_in_store, wp.is_action wp_is_action, wp.is_outofstock wp_is_outofstock, datediff(action_end, curdate()) action_expired, wp.name_hun wp_name, wp.sef_link wp_sef_link, wct.sef_name wct_sef_name, wmc.sef_name wmc_sef_name, IFNULL((SELECT wpi.file_name FROM wshp_product_image wpi WHERE wpi.product = wp.id AND wpi.is_active = 1 ORDER BY weight LIMIT 1), 'noimage.jpg') wpi_file_name, IFNULL((SELECT wpi.width FROM wshp_product_image wpi WHERE wpi.product = wp.id AND wpi.is_active = 1 ORDER BY weight LIMIT 1), 134) wpi_width, IFNULL((SELECT wpi.height FROM wshp_product_image wpi WHERE wpi.product = wp.id AND wpi.is_active = 1 ORDER BY weight LIMIT 1), 134) wpi_height, wt.percentage wt_percentage, datediff(curdate(), wp.uploaded) wp_uploaded_days, (SELECT COUNT(*) FROM wshp_cart_items wci, wshp_cart wc WHERE wci.product = wp.id AND wci.is_active = 1 AND wci.cart = wc.id AND wc.is_active = 1 AND wc.stat > 2) AS popularity FROM wshp_product wp, wshp_product_category_tree wpct, wshp_category_tree wct, wshp_tax wt, wshp_main_category wmc WHERE wp.is_public = 1 AND wp.is_active = 1 AND wp.main_category = wmc.id AND wp.id = wpct.product AND wct.id = wpct.category_tree AND wpct.is_active = 1 AND wct.is_active = 1 AND wct.sef_name = 'arnyekolo_napvitorla_sator_pavilon' AND wp.tax = wt.id ORDER BY popularity DESC, wp.id ASC LIMIT -40, 40

Filename: models/PagesModel.php

Line Number: 637