php mysql like 實現(xiàn)多關(guān)鍵詞搜索的方法
或者叫,分詞檢索數(shù)據(jù)庫
$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%'"); //這樣寫都是正確的;
以上就是小編為大家?guī)淼膒hp mysql like 實現(xiàn)多關(guān)鍵詞搜索的方法全部內(nèi)容了,希望大家多多支持腳本之家~
相關(guān)文章
php注冊系統(tǒng)和使用Xajax即時驗證用戶名是否被占用
這篇文章主要為大家詳細介紹了php注冊系統(tǒng)和使用Xajax即時驗證用戶名是否被占用,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-08-08
解決PHP mysql_query執(zhí)行超時(Fatal error: Maximum execution time …)
本篇文章是對解決PHP mysql_query執(zhí)行超時(Fatal error: Maximum execution time of 300 seconds exceeded in…)的問題進行了詳細的分析介紹,需要的朋友參考下2013-07-07

