我的网站上有搜索表单,它会根据搜索的单词顺序返回不同的结果。这是我在 WHERE 之后对两个搜索词进行的查询的一部分:
(name_ru = '".words[0]."' or name_ru like '".words[0]."%' or name_ru like '% ".words[0]."%' or name_ru like '"".words[0]."%' or brief_description_ru like '%".words[0]."%' or product_code like '%".words[0]."%' or product_code in (select product_code from ALLPRODUCTS where searchfilter like '%".words[0]."%')) or product_code in (select product_code from SC_products prd JOIN SC_product_manufacturers mnf ON prd.manufacturerID=mnf.manufacturerID where mnf.filters like '%".words[0]."%')
AND (name_ru = '".words[1]."' or name_ru like '".words[1]."%' or name_ru like '% ".words[1]."%' or name_ru like '"".words[1]."%' or brief_description_ru like '%".words[1]."%' or product_code like '%".words[1]."%' or product_code in (select product_code from ALLPRODUCTS where searchfilter like '%".words[1]."%')) or product_code in (select product_code from SC_products prd JOIN SC_product_manufacturers mnf ON prd.manufacturerID=mnf.manufacturerID where mnf.filters like '%".words[1]."%')
当我更改这两个单词的顺序时,结果包含不同的行数。我应该怎么做才能得到每次相同的结果,这不取决于单词顺序?