Query Error:

SELECT child_id, child_type, relation_fake, relation_publish_date_timestamp, relation_expiry_date_timestamp FROM relationships WHERE () AND (relation_active = '1' AND relation_visible = '1' AND (relation_list_hidden IS NULL OR relation_list_hidden = '') AND child_type = 'page') AND ((relation_publish_date_timestamp <= UNIX_TIMESTAMP() AND relation_expiry_date_timestamp >= UNIX_TIMESTAMP()) OR (relation_publish_date_timestamp <= UNIX_TIMESTAMP() AND relation_expiry_date_timestamp IS NULL) OR (relation_publish_date_timestamp IS NULL AND relation_expiry_date_timestamp IS NULL)) ORDER BY relation_order DESC

Errore: 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 (relation_active = '1' AND relation_visible = '1' AND (relation_list_hidde' at line 1