[thelist] U.S. Cities

Steve Lewis nepolon at worlddomination.net
Thu Aug 11 17:19:31 CDT 2005


Dena Marchant wrote:
> Does anyone have suggestions on how to ensure that cities entered
> into a database through a web form will be:
> 
> 1. spelled correctly
> 2. valid
> 3. not duplicates

throwing other ideas out there:

First, you will need to consider the state + city as a unique key. 
Consider the city of Springfield as an example of why.

Secondly, if no exact match is found, use the soundex algorithm to find 
possible matches.  Ask folks if the city they meant to select is in the 
list of soundex matches.  If not, add the city to your known-cities list 
in that state.

-- 
SteveL


More information about the thelist mailing list