$this->load->model('User_model'); $count = $this->User_model->count_by('age >', 18); echo "There are " . $count . " users over 18 years old.";
$this->load->model('Product_model'); $count = $this->Product_model->count_by('status', 'active'); echo "There are " . $count . " active products.";This will output something like "There are 231 active products." The MY_Model library is a package for CodeIgniter, a PHP framework for web development.