$this->db->select('(select GROUP_CONCAT(nama SEPARATOR \' , \') AS order_summary  from produk as b where b.parent = a....

mysql example codeigniter concat

    $this->db->select('(select GROUP_CONCAT(nama SEPARATOR \' , \') AS order_summary  from produk as b where b.parent = a.id and b.status=1)as variasi,a.*');
                        if(!empty($keyword)){
                            $this->db->like('a.nama',$keyword);
                        }

                        if(!empty($kategori)){
                            $this->db->where('a.kategori_id',$kategori);
                        }

                        $this->db->where('a.parent',$parent);
                      $this->db->order_by('a.nama','ASC');
                        $cek = $this->db->where('a.status','1')->get('produk as a')->result_array();

0 comments: