I’ll explain my problem:
I have a database table called country. It has two columns: ID and name.
When I want to search for 'paris', but misspelled the word: 'pares' ('e' instead of 'i'), I won’t get any result from DB.
I want the the system to suggest similar words that could help in the search.
So, I am looking for help writing a script that makes suggestions from the DB that contain similar words like: paris, paredes, … etc.
In PHP you should use
metaphoneit is more accurate thansoundex.But your problem is getting the data from the database. You’ve not mentioned the DB. In MySQL you can make use of the
SOUNDEXfunction. You just need to change your where clause in the query fromto
or even better you can use
SOUNDS LIKEoperator as