php - Codeigniter: Simple echo of data from DB -
what best way create model can call controller this?
$this->model_model->function->dbname
i have following model rubbish:
model:
function systemname() { $query = $this->db->query("select cms_name options"); return $query->result(); }
update:
function systemoptions($options) { $this->db->select($options); $query = $this->db->get('options'); return $query->num_rows(); }
why want to? why not call this?:
$this->model_model->functionname('dbname');
a complete skeleton of model this:
<?php class mymodel extends model { function get_some_entries($number_rows) { return $result = $this -> db -> query("select id, name tablename limit $number_rows"); } } ?>
Comments
Post a Comment