Invalid query: 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 's Dream' AND year=1989 AND tmorl='L'' at line 1 Whole Query: SELECT * FROM casts WHERE title='A Midsummer Night's Dream' AND year=1989 AND tmorl='L'