Invalid 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 '-6, 6' at line 21
Whole query: SELECT *, (SELECT COUNT(comments_id) FROM comments as com WHERE com.product_id=p.product_id AND com.comments_status='1') as comments_num, (SELECT SUM(comments_rate) FROM comments as com WHERE com.product_id=p.product_id AND com.comments_status='1') as comments_rate_sum, (SELECT AVG(comments_rate) FROM comments as com WHERE com.product_id=p.product_id AND com.comments_status='1') as comments_rate_avg, (SELECT SUM(comments_like) FROM comments as com WHERE com.product_id=p.product_id AND com.comments_status='1') as comments_like_sum , (SELECT product_template_input_value FROM product_template_to_type_mapping as start_pt2tm1, product_template_to_type as start_pt2t1 WHERE start_pt2t1.product_template_field = "event_start_date" AND start_pt2tm1.product_template_item_id=start_pt2t1.product_template_item_id AND start_pt2t1.product_template_languages_id=1 AND start_pt2tm1.product_template_languages_id=1 and start_pt2tm1.product_template_product_id = p.product_id ) AS event_start_date_order , (SELECT product_template_input_value FROM product_template_to_type_mapping as start_pt2tm1, product_template_to_type as start_pt2t1 WHERE start_pt2t1.product_template_field = "event_visibility_end_date" AND start_pt2tm1.product_template_item_id=start_pt2t1.product_template_item_id AND start_pt2t1.product_template_languages_id=1 AND start_pt2tm1.product_template_languages_id=1 and start_pt2tm1.product_template_product_id = p.product_id ) AS event_visibility_end_date_order FROM product AS p INNER JOIN to_user AS p2u ON (p.product_id=p2u.ref_id AND p2u.ref_table="product") INNER JOIN to_view AS p2v ON (p.product_id=p2v.ref_id AND p2v.ref_table="product") INNER JOIN product_to_menu AS p2m ON p.product_id = p2m.product_id INNER JOIN product_menu AS pm ON pm.product_menu_id = p2m.product_menu_id LEFT JOIN wbm_user AS u ON p2u.wbm_id=u.wbm_id WHERE p2m.product_menu_id IN (45) AND p.product_languages_id = 1 AND pm.product_menu_languages_id = 1 AND p.product_status = "1" ORDER BY event_start_date_order DESC LIMIT -6, 6