CodeIgniter models

All CodeIgniter models have the same initial structure:

< ?php
class Page_model extends Model{
function Page_model(){
parent::Model();
}
}
? >

The first function is the code that retrieves the home page

< ?php
class Page_model extends Model{
function Page_model(){
parent::Model();
}
function fetchHomePage(){
$data = array();
$options = array(‘status’ = > ‘live’, ‘type’= > ‘home’);
$q = $this- > db- > getwhere(‘pages’, $options, 1);
if ($q- > num_rows() > 0){
$data = $q- > row_array();
}
return $data;
$q- > free_result();
}
}
? >

Notice that the name of the model  Page_model  is both the
 name of the class and the name of the initializing function.
 This file is stored in the /system/application/models/ folder
 of your project, more than likely with a name
 like page_model.php.