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 NEW_Hotels.editions LIKE '%2012%'' at line 5SELECT NEW_Hotels.* FROM NEW_Countries INNER JOIN NEW_Areas ON NEW_Countries.id=NEW_Areas.countryid INNER JOIN NEW_Towns ON NEW_Areas.id=NEW_Towns.areaid INNER JOIN NEW_Hotels ON NEW_Towns.id=NEW_Hotels.town WHERE NEW_Countries.id= AND NEW_Hotels.editions LIKE '%2012%'