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 pages_s1= AND pages_s2= AND pages_s3=0 AND pages_published=1' at line 1

SELECT pages_id, pages_title FROM p_pages WHERE pages_nav= AND pages_s1= AND pages_s2= AND pages_s3=0 AND pages_published=1