Answer the question
In order to leave comments, you need to log in
How to search for MULTIPLE words in the mysql database, regardless of the order, the length of the words is 1-4 letters?
How to search for MULTIPLE words in the mysql database, regardless of the order, the length of the words is 1-4 letters? For example, there is an entry aaa + bbb + ccc and the user enters ccc + aaa + bbb to find the entry, I wrote like
'% ccc% aaa% bbb%' but he does not find this entry because the order is wrong, maybe there is some construction in mysql so that the search is carried out without any order, do not iterate over all cases, thanks in advance
Answer the question
In order to leave comments, you need to log in
WHERE (field_name LIKE %aaa% AND field_name LIKE %bbb% AND field_name LIKE %ccc%)
Use the regular expression REGEXP instead of LIKE, there will be many more possibilities, but also a load more
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question