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 's Hill' and id != '38981'' at line 1

select id from locations_new where postcode = 'WS10' and title = 'King's Hill' and id != '38981'