0
私はcountry-state-district
としてデータを取得できるようにグループを使用したいと思います。私は国を表示したいだけですし、州レベルではチェックボックスを追加します。質問が正解にならない
$this->db->distinct();
$this->db->select('country_name,s_name,dist_name');
$this->db->from('resource_details');
$this->db->join('location','reso_dtail_location=loc_id');
$this->db->join('go_state', 'go_stste_id = loc_state', 'left');
$this->db->join('go_country', 'num = loc_country', 'left');
$this->db->join('go_dist', 'id = loc_district', 'left');
$this->db->where('loc_id !=1 AND loc_id !=2');
$query = $this->db->get();
//result
$location = $query->result();
が、クエリがgroup_by
を使用した後、それが唯一のあなたは国によってグループを使用することができる第一のレコード
何をしたいですか? – Vinie
コードのどこにでも 'group_by'が見当たりませんでしたか? –
'echo $ this-> db-> last_query()'であなたの質問をチェックしてください。あなたが得ているエラー/結果は何ですか? –