如何在Codeigniter中将数组值转换为字符串

时间:2019-11-08 05:11:08

标签: php mysql codeigniter-3

如何在codeIgniter中将字符串转换为数组并将该值与另一个表及其值连接起来

function getpackages(){
    $sql = "SELECT group_concat(Test_id separator ',') as Test_id  FROM `tbl_package` ";
    $query = $this->db->query($sql);
    $array1 = $query->row_array();
    $arr = explode(',',$array1['Test_id']);
    $this->db->select('*');
    $this->db->from('tbl_tests');
    foreach ($arr as $rows) 
    {
      $this->db->or_where('Test_id',$rows);
    }
    $query = $this->db->get();
    return $query->result(); 
}

0 个答案:

没有答案