[eluser]libnac[/eluser]
I think you must use models.
you can use models in this way:
yourmodelmodel.php
class Yourmodel extends Model {
function Yourmodel() {..}
function view1() {
$select_sql = "table1.*, .... ";
return executeQry($select_sql);
}
function view2() {
...
}
...
function executeQry($select_sql) {
$this->obj->db->select($select_qry);
$query = $this->obj->db->get();
if($query->num_rows()>0 )
return $query->result();
}
}
}
or something like this...
And you can load this model in your controller constructor.
class Yourcontroller extends Controller {
function Yourcontroller() {
$this->load->model("yourmodelmodel")
}
}
I hope this will be useful for you