php/mysql. Is there mysql function to detect if at least 2 certain words exists in at least one mysql row-field

前端 未结 2 1049
予麋鹿
予麋鹿 2021-01-24 04:13

For example, I have php array $php_arr_to_check = array(\"green\", \"red\", \"blue\");

And have many mysql rows like this

Id  |  TextToCheck         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 05:00

    I haven't MySQL for to test next query. You try something:

    SELECT Id, TextToCheckIn REGEXP "(${word1})|(${word2})" AS Flag
    FROM table
    WHERE Flag = 1
    

提交回复
热议问题