OK i will write as clear as possible
it’s an e-commerce web site and there is a lot of goods
so i have a searching form that send’s the input to a php script via jquery’s post
method(ajax) now what i want to do is to check if the input (from the form) is equal
or close to one of the word’s in my DB but i cant write a regexp for every single word so is
there a solution ???
for example if the client want to see our offers for pentuim 4 and he wrote peniuom it should tell that “do you mean pentuim”
i hope that i can get an answer now
You could just send the user input to a
LIKEquery and get the database to do the search work – they are pretty good at that 🙂If there are no results for an exact match then you could pass the search terms through a spell-checker first or use a fuzzy search.
How do I do a fuzzy match of company names in MYSQL with PHP for auto-complete? might also help.