《PHP實(shí)戰(zhàn):php mysql like 實(shí)現(xiàn)多關(guān)鍵詞搜索的方法》要點(diǎn):
本文介紹了PHP實(shí)戰(zhàn):php mysql like 實(shí)現(xiàn)多關(guān)鍵詞搜索的方法,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
PHP學(xué)習(xí)或者叫,分詞檢索數(shù)據(jù)庫(kù)
PHP學(xué)習(xí)$res = mysql_query("select * from peter where id like '%中草藥%' and '%6%'"); //這樣寫(xiě)是報(bào)錯(cuò)的;
PHP學(xué)習(xí)$res = mysql_query("select * from peter where id like '%中草藥%' or '%6%'"); //而這樣寫(xiě)是正確的;奇怪~
PHP學(xué)習(xí)?
PHP學(xué)習(xí)$res = mysql_query("select * from peter where id like '%中草藥%' and id like '%6%'"); //這樣寫(xiě)是正確的;
PHP學(xué)習(xí)$res = mysql_query("select * from peter where id like '%中草藥%' or id like '%6%'"); //這樣寫(xiě)都是正確的;
PHP學(xué)習(xí)以上就是小編為大家?guī)?lái)的php mysql like 實(shí)現(xiàn)多關(guān)鍵詞搜索的方法全部?jī)?nèi)容了,希望大家多多支持維易PHP~
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/2922.html