I have a table with the following info:
id | user_id | points -------------------------- 1 | 12 | 48 2 | 15 | 36 3 | 18 | 2
$this->db->select('overal_points'); $this->db->where('point_publish', 1); $this->db->order_by('overal_points', 'desc'); $query = $this->db->get('company', 4)->result();