sql like multiword
- Started
- Last post
- 4 Responses
- mikotondria3
hey hey..in MySQL...
I have a table where each entry has words in a keywords field, each word separated by ;, eg
apple; apple sauce; apple sauce recipes;
etc..
I am trying to link up a search function, and am applying the search term against the keywords field with a LIKE statement, thusly..
SELECT * FROM recipes WHERE keywords LIKE 'entered search term%'It works fine with 1 and 2 word queries, but when I increase it to three, eg "apple sauce recipes", I dont get a result.
Any ideas ?
- redant0
"LIKE has a major drawback you can only search for one word at a time not multiple words!"
- mikotondria30
true true, thanks redant, what I was needing fulltext indexing and searching.
- redant0
Whatever you say :) I thought I'd try n help. I'm a newbie with all that!!!
- acescence0
if you have a fulltext index, use MATCH and AGAINST t search it