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 languages_id=1 AND publication_id=16 AND datetime_stamp<>'0000-00-00' AND ((' at line 1
SELECT * FROM photo_news as main WHERE news_id_root=58 AND parent_id= AND languages_id=1 AND publication_id=16 AND datetime_stamp<>'0000-00-00' AND (((publication_start='0000-00-00' OR CURDATE()>=publication_start) AND (publication_end='0000-00-00' OR CURDATE()<=publication_end)) OR (users_id_author=0 AND users_id_author<>0) OR 1=2) AND current_flag=1 ORDER BY pwrord desc, newsdate desc,news_ord LIMIT 1