【发布时间】:2012-06-12 04:23:08
【问题描述】:
创建模型以便我可以像这样从控制器调用它的最佳方法是什么?
$this->model_model->function->dbname
我有以下模型,但它是垃圾:
型号:
function systemName()
{
$query = $this->db->query("SELECT cms_name FROM options");
return $query->result();
}
更新:
function systemOptions($options)
{
$this->db->select($options);
$query = $this->db->get('options');
return $query->num_rows();
}
【问题讨论】:
标签: php sql codeigniter model