当我加载会话库时仅显示找不到指定的类:会话.php下面是代码
$ci =& get_instance();
$ci->load->database();
$ci->load->library('session');
if($ci->session->userdata('loggedin')){
if($ci->session->userdata('owner_id')==0){
$query = $ci->db->query("SELECT * FROM system WHERE user_id=".$ci->session->userdata('id')." LIMIT 1");
}else{
$query = $ci->db->query("SELECT * FROM system WHERE user_id=".$ci->session->userdata('owner_id')." LIMIT 1");
}
}else{
$query = $ci->db->query("SELECT * FROM system WHERE id=1 LIMIT 1");
}
您可以使用构造函数来加载会话
public function __construct() {
parent::__construct();
$this->load->library('session');
}
或在应用程序/配置/自动加载中加载会话库.php
$autoload['libraries'] = array('session');
希望会有所帮助