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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -