php - Query-not getting right answer -
i want used group can data country-state-district
. want display country state , district level want add checkbox.
$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 , loc_id !=2'); $query = $this->db->get(); //result $location = $query->result();
but query not give right answer after using group_by
shows 1st record
you can use group country. can distinct country name. states , city can use group concat.
Comments
Post a Comment