Error SQL (select dg.id_gracias,dg.urlAporteFull, c.idc, c.img_id, c.title, c.content_year, dg.id_formato, dg. type_lenguage, dg.nikname_user from dw_content c inner join dwt_gracias dg on dg.id_content = c.idc where dg.type_lenguage = and dg.type_dwd='dwd_vvs' and dg.urlAporteFull!='' and dg.mirrors!='' and c.idc not in ('0','7991','9086','9698','9847') group by c.idc order by c.content_year desc LIMIT 4): 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 dg.type_dwd='dwd_vvs' and dg.urlAporteFull!='' and dg.mirrors!='' and c.idc' at line 3