|
楼主 |
发表于 2010-1-25 16:42:09
|
显示全部楼层
本帖最后由 penglu3000 于 2010-1-25 16:46 编辑
多谢版主指教,我根据你说的改动一下还是报错。
PHP复制代码 class MY_Config extends CI_Config {
function My_Config ()
{
parent ::CI_Config();
$this->ci =& get_instance ();
$this->ci->load->database();
}
function db_item ($name){
$this->ci->db->select($value);
$this->ci->db->from('config');
$this->ci->db->where('name',$name);
$query = $this->ci->db->get();
if($row = $query->row_array()){
return $row['value'];
}else{
return FALSE;
}
}
function db_set ($name,$value){
$data = array(
'value' => $value
);
$this->ci->db->where('name', $name);
$this->ci->db->update('config', $data);
}
} 复制代码
报错:
Fatal error: Call to undefined function get_instance() in D:\workspace\store\system\application\libraries\MY_Config.php on line 6 |
|