2016-06-29 2 views
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を使用した後、それが唯一のあなたは国によってグループを使用することができる第一のレコード

+0

何をしたいですか? – Vinie

+0

コードのどこにでも 'group_by'が見当たりませんでしたか? –

+0

'echo $ this-> db-> last_query()'であなたの質問をチェックしてください。あなたが得ているエラー/結果は何ですか? –

答えて

0

を示して正しい答えを与えるものではありません。あなたは別の国名を得ることができるように。しかし、州や都市では、グループの連結を使用することができます。

関連する問題