Error performing query SELECT schools.altID as id,schools.school,counties.id as foo FROM schools,states,counties WHERE counties.county = 'O'brien' AND states.state = 'Iowa' AND counties.stateID = states.id AND schools.county = counties.id ORDER BY schools.school - 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 'brien' AND states.state = 'Iowa' AND counties.stateID = states.id ' at line 3