I have code to search the typed words from the text box, Get the typed word, search it in the web sql database and show the result in the HTML page.
In that i can search the word exactly as it is, using LIKE.
(i.e)
SELECT * FROM tblName WHERE SearchWord LIKE %<typedword>%
If the table has,
- Hello Doctor
- Hi Sir
- Hello World
- Welcome Programmer
And the user types as "Hello", it shows me
**Hello** Doctor
**Hello** World
I need to display the result even if the user wrongly arranges the words,
i.e If the user types as "World Hello"
It is not showing any results. But, I want to show the user
Hello World
Can you please help me?
So you want an AND search using each of the words entered, rather than the exact string? Howabout something like this:
this will give you a query like:
change the AND to an OR if you want to match any of the search terms rather than all.