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 alt_id= and (sy_tarih>='2014-04-18' or sy_tarih='0000-00-00') ORDER BY id' at line 1