--- In [email protected], James Keeline <[EMAIL PROTECTED]> wrote:
>
> --- andrew_maben <[EMAIL PROTECTED]> wrote:
> 
> > Thanks, James. Yes I was thinking about soundex - how about:
> > 
> > $first_part = substr($first_name,0,3) . '%';
> > $last_part = substr($last_name,0,3) . '%';
> > $sql = "SELECT first_name, last_name 
> >             FROM names_table 
> >             WHERE ((first_name LIKE '$first_part' 
> >             AND last_name LIKE '$last_part')
> >             OR (STRCMP(SOUNDEX(first_name), SOUNDEX('$first_name')) = 0
> >             AND STRCMP(SOUNDEX(last_name), SOUNDEX('$last_name')) = 0)";
> > 
> > I'm going to do some tests based on this - any further thoughts would be 
> > very
> > welcome.
> > 
> > Andrew
> 
> So, you're saying that a match of the first three characters in either name or
> a generated soundex value are what you are looking for?
> 
> When dealing with first names you also have the problems with synonyms which
> don't share the first three letters:  (Robert, Rob, Bob) (Richard, Rich, Dick)
> (Alexandra, Lexie)
> 
> That's why I said that you might have to come up with your own synonym lists 
> --
> unless there are some out there already.
> 
> James
>

Thanks again. Basically you've made me see that I'm trying to be too clever. 
What's going 
to happen is the user will get back a list telling her "This entry/these 
entries *may* be the 
same person", so I'm just going to do the last name portion. There will be more 
bad 
matches, but the human eye can scan a shortish list pretty quickly.

Andrew


Reply via email to