$this->load->model('product_model'); $products = $this->product_model->get_order_by('price', 'desc');
$this->load->model('post_model'); $posts = $this->post_model->get_order_by('created_at', 'desc', 5);In both examples, we are using the MY_Model get_order_by method to retrieve records from the database and order them based on our criteria. The MY_Model package library is a lightweight database abstraction layer for CodeIgniter 3.x, providing a base model class with CRUD operations and other helpful methods.