php - mysql find best matching word in one row -


i have following table:

------------------------ | uid |  attrvalue     | ------------------------ | 1   |  spray         | | 2   |  strong        | | 3   |  strong   | | 999 |  creme         | ------------------------ 

now have query in php , find rows queries found.

select * attrtable match (attrvalue) against ('spray+very+strong' in boolean mode); 

i finds row 1 , 3. resultrows 1, 2 , 3.

so important founds words or word combinations in table rows. query doesn't contain words or combined words aren't in table (i check first).

just use like, other way around used to.

select query table1 'attrvalue' concat(query,'%') order length(query) desc limit 1 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -