An Error Was Encountered

Error Number: 1064

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 'AND p.town_id = t.id' at line 1

SELECT p.*, t.town_name from properties p, towns t WHERE p.id = AND p.town_id = t.id