You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'roque limit 0,16' at line 12
SELECT p.*,tp.tpPubl,i.archivo,l.localidad, p.anyoDesde 'desde', case when p.anyoHasta= '3000' then 'presente' else p.anyoHasta end 'hasta' FROM `publicaciones` p left join tipospubl tp on tp.PKtpPubl=p.FKtpPubl left join imagenes i on i.FKrespCabeImpr=p.FKcabecera and i.FKgrupoimg = 2 left join localidades l on l.PKlocalidad=p.FKlocalidad where (p.FKtpPubl in (parroquial)) and (p.titulo like '%3004%' or l.localidad like '%3004%' or p.subtitulo like '%3004%') and (p.anyoDesde<=hoha ) and (p.anyoHasta>=publicacion/la ) and p.anyoDesde>0 and p.anyoHasta>0 group by p.FKcabecera order by san roque limit 0,16