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 Waltham' and id != '32796'' at line 1
select id from locations_new where postcode = 'SO32' and title = 'Bishop's Waltham' and id != '32796'