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 'N'DOLLESS'' at line 1 *** SQL *** SELECT count(*) total FROM manga_series ms left join index_artists ia on ia.series_id = ms.series_id where ms.total_chapters>0 and ms.is_online=1 AND ia.artist='ROCK'N'DOLLESS'