我第一次愿意添加多个搜索。我不知道该怎么做。我应该在搜索中使用循环每个单词吗?或者是否有任何内置的mysql函数呢?可能在codeigniter中搜索多个单词吗?
我在想这应该是这样吗?
$strSearch = $this->input->post("search"); // would hold words etc hello word
$arry = explode(" ", $strSearch);
foreach($arry as $item){
$this->db->query("select * from tbl where item like '%$item%');
}
请指教。
谢谢