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 r.landid = c.element_ID' at line 1 Query: SELECT c.land FROM regionen_e r, laender_e c WHERE r.element_ID = AND r.landid = c.element_ID