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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -