或者叫,分詞檢索數據庫
$res = mysql_query("select * from peter where id like '%中草藥%' and '%6%'"); //這樣寫是報錯的;
$res = mysql_query("select * from peter where id like '%中草藥%' or '%6%'"); //而這樣寫是正確的;奇怪~
$res = mysql_query("select * from peter where id like '%中草藥%' and id like '%6%'"); //這樣寫是正確的;
$res = mysql_query("select * from peter where id like '%中草藥%' or id like '%6%'"); //這樣寫都是正確的;
以上就是小編為大家帶來的php mysql like 實現多關鍵詞搜索的方法全部內容了,希望大家多多支持~