Because Counties and Cities can be added separately, and as far as
Ad priority the City is prioritised over County (but both are
taken into account), in some cases the County has to be found by
searching for a member with that City in the Members table, and
finding out what County that member has. This means that if there
is any member in the members table that has a city in the wrong
county (and there is at least one), it will mess up the
city/county relation. I have added an extra check that looks at
the member's county before it searches through the database.
What this means is that now, as long as a member has a county set,
its own county will be looked at as far as which ad to pull
(even if the county is wrong!) and only if it doesn't find one,
uses the city to find a member in the database that has that city
and grabs that member's county (again, even if it's wrong!).
This also means that there is currently a member with a wrong
county or city, somewhere in the database. Finding out which one
it is would take deeper and more thorough investigation.