或者叫,分詞檢索數(shù)據(jù)庫(kù)
$res = mysql_query("select * from peter where id like '%中草藥%' and '%6%'"); //這樣寫(xiě)是報(bào)錯(cuò)的;
$res = mysql_query("select * from peter where id like '%中草藥%' or '%6%'"); //而這樣寫(xiě)是正確的;奇怪~
$res = mysql_query("select * from peter where id like '%中草藥%' and id like '%6%'"); //這樣寫(xiě)是正確的;
$res = mysql_query("select * from peter where id like '%中草藥%' or id like '%6%'"); //這樣寫(xiě)都是正確的;
以上就是小編為大家?guī)?lái)的php mysql like 實(shí)現(xiàn)多關(guān)鍵詞搜索的方法全部?jī)?nèi)容了,希望大家多多支持VeVb武林網(wǎng)~
新聞熱點(diǎn)
疑難解答
圖片精選