/***
* Get username
*/
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 should give the query field, such as where('id',$admin_id)
First, check whether your $user_name has got a value; then check
Is the where syntax wrong?
Where should give the query field, such as where('id',$admin_id)
First, check whether your $user_name has got a value; then check
Is the where syntax wrong?