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-2-9-2005'' at line 1 select id,idUser,tipo,titol,introduccio,contingut,titolUrl,fecha,id,visitas from madteam_usuaris.usuarisEntradas where public='si' and idUser='220' and titolUrl='the-fuixarda-return's-2-9-2005'