G
G
GoodPirojok2020-10-19 10:48:46
PHP
GoodPirojok, 2020-10-19 10:48:46

How to do a search by matching two or more words anywhere in mysql?

How to do a search by matching two or more words anywhere in mysql?
In this case, he is looking for matches of the entire sentence %$text%
. If we enter "Potato from Armenia" in the search, in the line Хорошая картошка из армении- he will find a match, but
in the search Картошка хорошая из армении, he will not find it.

How to search by matching all words in any sequence?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
generate, 2020-10-19
@GoodPirojok

SELECT * FROM test 
           WHERE SOUNDEX(name) 
LIKE CONCAT('%',SUBSTRING(SOUNDEX('Картошка хорошая из армении'),2),'%');

Source

F
FanatPHP, 2020-10-19
@FanatPHP

Learning to use the Internet

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question