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 'limit 0,16' at line 3
SELECT i.PKimprenta, i.imprenta, l.localidad FROM imprentas i INNER JOIN localidades l ON i.FKlocalidad = l.PKlocalidad WHERE 1 and (i.imprenta like '%1873%' or l.localidad like '%1873%') group by i.PKimprenta order by match limit 0,16