public function get_categories($category_id = false, $order_by = null, $sort = 'DESC', $limit = null, $offset = 0) {... if ($category_name) { $this->db->where('categories.id', $category_id); }...