Skip to content

Instantly share code, notes, and snippets.

@virbo
Created April 19, 2016 14:08
Show Gist options
  • Save virbo/1e0b1efb456236cdb3d66e8d2d50f39c to your computer and use it in GitHub Desktop.
Save virbo/1e0b1efb456236cdb3d66e8d2d50f39c to your computer and use it in GitHub Desktop.
Fungsi tambahan untuk file Alumni_model.php
public function get_location_by_id($id)
{
$this->db->select('al.nm_alumni,CONCAT(rd.name, \', \', rp.name) AS lokasi')
->from('modul_alumni AS al')
->join('villages AS rd','al.id_wil=rd.id')
->join('districts AS rk','rd.district_id=rk.id')
->join('regencies AS rb','rk.regency_id=rb.id')
->join('provinces AS rp','rb.province_id=rp.id')
->where('al.id_wil',$id);
return $this->db->get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment