How to check input for possible close match with A DB

Ok i will write as clear as possible

it is an e-commerce website and there are many products

so i have a search form that submits input to php script via jquery post

method (ajax) now what i want to do is check if input is equal (from form)

or close to one of the words in my database, but I can’t write a regular expression for every single word, so

there is a solution

for example, if a client wants to see our offers for pentuim 4, and he wrote a penium, he must say that "you mean pentuim"

I hope that I can get an answer now

-1
source share
1 answer

You can just send user input to the LIKE request and get the database to perform the search - they are pretty good at that :-)

If there are no results for an exact match, you can first pass search queries using spell checking or use a fuzzy search.

How do I make a fuzzy match for company names in MYSQL with PHP for autocomplete? may also help.

+1
source

All Articles