You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND OI.orit_active= 'Y'
AND O.orde_active = 'Y'
' at line 7Error query_page_front: SELECT P.page_menu_name, P.page_content, P.page_summary, P.page_more_information, count(OI.orit_id) as page_count_suppliers
FROM pages AS P
INNER JOIN orders_items AS OI on OI.page_id = P.page_id
INNER JOIN orders AS O on O.orde_id = OI.orde_id
INNER JOIN companies AS C on C.comp_id = O.comp_id
WHERE P.page_id =
AND OI.orit_active= 'Y'
AND O.orde_active = 'Y'
AND C.comp_active = 'Y'