PHP数组到字符串转换错误

时间:2013-08-21 21:40:37

标签: php search indexing

148         /**
149          * Count
150          *
151          * Count relevant search results for a specific term
152          *
153          * @param       string  $query  Query or terms to search for
154          * @return      array
155          */
156         public function count($query)
157         {
158                 return $this->db
159                         ->where('MATCH(title, description, keywords) AGAINST ("*'.$this->db->escape_str($query).'*" IN BOOLEAN MODE) > 0', null, false)
160                         ->count_all_results('search_index');
161         }

第159行输出数组到字符串转换错误。这让我疯狂。 :(

1 个答案:

答案 0 :(得分:0)

更改

返回$ this-> db                          - > where('MATCH(标题,描述,关键字)AGAINST(“'。$ this-> db-> escape_str($ query)。'”在BOOLEAN模式中)> 0 ',null,false)                          - > count_all_results( 'search_index');

返回内爆($ this-> db                          - > where('MATCH(标题,描述,关键字)AGAINST(“'。$ this-> db-> escape_str($ query)。'”在BOOLEAN模式中)> 0 ',null,false)                          - > count_all_results( 'search_index'));