--- 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

Reply via email to