Notice: Undefined offset: 0 in /var/www/html/ on line 14 Fatal error: mysql error: [1064: 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 (dp_document_segments.page_id = 1 OR dp_document_segments.page_id = 0)AND dp' at line 4] in EXECUTE("SELECT dp_document_segments.*, dp_document_segment_formats.segment_format FROM dp_document_segments INNER JOIN dp_document_segment_formats ON dp_document_segment_formats.doc_smt_format_id = dp_document_segments.doc_smt_format_id WHERE dp_document_segments.doc_id = AND (dp_document_segments.page_id = 1 OR dp_document_segments.page_id = 0)AND dp_document_segments.doc_smt_type_id = 1 AND status_id = 0 ORDER BY priority_id") in /var/www/html/ on line 77