[eluser]TheFuzzy0ne[/eluser]
To ascertain the position in the table, something like this should work:
Code:
$results_per_page = 15;
$id = 25;
$this->db->select('COUNT(*) AS count', FALSE);
$this->db->where('id <=', $id);
$this->db->order_by('id');
$this->db->get('companies');
$res = $this->db->get($this->table);
$res = $res->row_array();
$position = $res['count'];
$page_num = ceil($position / $results_per_page);
The largest block of code can easily be exported to a model method.