Error!

MySQL Error: 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 published=1 and date(publish_date) <= '2012-02-12' and magazine_id=1' at line 1
SQL Statement: SELECT count(*) as total_records FROM contents JOIN content_types on contents.content_type_id = content_types.id WHERE content_type_id= and published=1 and date(publish_date) <= '2012-02-12' and magazine_id=1