/***
* Benutzernamen erhalten
*/
public function left(){
$admin_id = session('admin_id');
$user_name=M("admin");
$user_name=$user_name-> ;where($admin_id )->find();
$this->assign('user_name',$user_name);
$this->display();
}
用户名:< ;td>{$user_name}</td>
where要给出查询的字段,列如where('id',$admin_id)
首先要看你的$user_name有没有拿到值;然后看
where语法错了吧