[eluser]umefarooq[/eluser]
for this you have to check your query CI active record preparing correct query or not print your query using $this->db->last_query();
Code:
after this line
$data['query'] = $this->db->get('players');
echo $this->db->last_query();
where you want to sort your result here
$data['players'] = $this->players_model->get_players($per_page, $this->uri->segment(3));
or here
$data['query'] = $this->db->get('players');