$this->db->like('caller_ip',$condition);
           
$this->db->select('caller_ip, send_ip,star_time,end_time');
           
$query = $this->db->get('voice');return $query->result_array();模糊这样写对么?不对改怎么改?

解决方案 »

  1.   

    应该没错  运行一下就知道对不对了
    echo  $this->db->last_query();  看看出来的sql语句是什么
      

  2.   

     隐隐约约冒失有个get_where方法。是吗
    class PitypeModel extends Model {
            $query = array(); 
            $query = $this->db->get_where(‘table_name’, array('recodname' => $pitypetype));
            $query->result(); 
      

  3.   

       
    return $this->db->select('caller_ip, send_ip,star_time,end_time')
    ->like('caller_ip',$condition)
    ->get('voice')->result_array();
      

  4.   

    直接打印sql出来看看就知道了
      

  5.   

    没有错!! 不过 你直接 返回 $query->result()就好了 干嘛又返回数组 有意思么