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 hoofdstuk_titel LIKE '%behandeling van dementie%'' at line 1SELECT id,hoofdstuk_nummer FROM publicaties WHERE thema_id= AND hoofdstuk_titel LIKE '%behandeling van dementie%'