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 '' at line 5

SELECT cs.crimeid, l.locationid, l.lat, l.lng, l.location, ct.title AS crimetype, cy.crimemonth, cy.crimeyear FROM crime_s cs INNER JOIN location l ON (l.locationid = cs.locationid) INNER JOIN crimeyear cy ON (cy.ID = cs.crimeyearid) INNER JOIN crimetype ct ON (ct.typeid = cs.crimetypeid) WHERE MBRContains(GeomFromText('Polygon((53.563143283409 -3.0729305076007, 53.592056716591 -3.0729305076007, 53.592056716591 -3.0242494923993, 53.563143283409 -3.0242494923993, 53.563143283409 -3.0729305076007))'), l.pt) AND cs.crimeyearid=