December 2013
Intermediate to advanced
306 pages
6h 26m
English
It's useful to count the number of results returned—often bugs can arise if a section of code which expects to have at least one row is passed zero rows. Without handling the eventuality of a zero result, an application may become unpredictably unstable and may give away hints to a malicious user about the architecture of the app. Ensuring correct handling of zero results is what we're going to focus on here.
$this->load->model('Some_model');
$data['num_results'] = $this->Some_model->some_model_function();
$this->load->view('some_view', $data);function some_model_function() ...
Read now
Unlock full access