|
本帖最后由 午灬夏 于 2012-4-15 10:16 编辑
数据表le_sessions 字段 user_data
a:8:{s:9:"user_data";s:0:"";s:6:"userid";s:1:"1";s:8:"username";s:5:"admin";s:8:"password";s:32:"e10adc3949ba59abbe56e057f20f883e";s:5:"email";s:16:"379559090@qq.com";s:8:"realname";s:9:"???";s:9:"logintime";N;s:7:"loginip";N;}
//获取当前登录用户信息
function get_user(){
$sessionid = $this->session->userdata('session_id');
if($sessionid != ''){
$sql = "SELECT * FROM le_sessions WHERE session_id='$sessionid' LIMIT 1";
$query = $this->db->query($sql);
$info = $query->row_array();//有数据
$user_data = unserialize($info['user_data']);
print_r($user_data);//输出空,不用unserialize 有输出!
return $user_data;
}else{
return array();
}
}
打印为空的!
|
|