Page 1 of 1

Match Human input string to database field

Posted: Mon Jun 26, 2006 12:22 am
by btm
Hi,
Basically, I have a field in a table that a person inputs a name of who they want their roommate to be. The roommate will already be in the table, the the name typed in might not exactly match the 'name' field in the table. My task is to generate a list of possible matches. I'm at a bit of a loss of how to accomplish this. I was thinking that I could do the first query, take the rommate field and remove all vowels, then query the table again and step through each 'name' field, remove the vowels, and see if they match, then print all matches. If anyone has any cleaner ideas than this, I'd love to hear them...
Thanks!

Posted: Mon Jun 26, 2006 2:59 am
by JayBird
Have a look at the soundex() function and levenshtein(), metaphone(), and similar_text().