public function get_username($uid)
{
$query =
$this->db->select('id')
->select('name')
->from('user_table')
->where('id', $uid)
->get();
return $query->result_array();
}
this will return the result with matched id and username to the controller.