I want to make a searching script where I can search for multiple words but the script finds the words in all the rows instead of a specific row. For example.
__________________________ ________ |Cheese | | Search | —————————————————————————— ————————
Then I make a php script that says:
SELECT * FROM table WHERE column1 = "$value" OR column2 = "$value" OR column3 = "$value" ... ;
This will show the results where the word"Cheese" appears in any of the columns. The thing is, that I want it to possible for people to search for both "cheese" and maybe "kitchen" but then I need to separate the words and search for something like this:
SELECT * FROM table WHERE column1 = "$value" OR column2 = "$value" OR column3 = "$value" ... AND column1 = "$value2" OR column2 = "$value2" OR column3 = "$value2" ... ;
The thing is that I really don't know how to do this. neither the word separation or how to find the words i the SQL database.. Also I don't know how to search for the words where "Cheese" is a part of.. like "Cheesecake"..
Please help me if anybody has an idea of how to make this..
Thank you.