2016-08-26 42 views
0

消息:笨:數組字符串轉換解決方案

陣列字符串轉換

文件名稱:models/db_get.php

function get_where_conditions1($tb,$where) 
{   
    $this->db->select('*'); 
    $this->db->distinct(); 
    $this->db->from($tb); 
    $this->db->join("restaurants", $tb.".".'restaurant_id = restaurants.id',"LEFT"); 
    $this->db->where_in('branches.'.'$where'); 
    $this->db->order_by('branches.id','desc'); 
    $query= $this->db->get()->result_array(); 
    $out=array_unique($query);  
    return $out;  
} 
+0

請發佈如何調用此功能與細節參數。 –

回答

0

在你的函數$必須在其中陣列,但不知道它的類型。

我認爲問題是行$ this-> db-> where_in('branches。'。'$ where'); 它應該是$ this-> db-> where_in('branches',$ where);