Home > Q&A > body text
/***
* 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>
123fan2018-10-18 14:42:48
Where should give the query field, such as where('id',$admin_id)
Summer2018-10-18 09:52:26
First, check whether your $user_name has got a value; then check
胤彬-2018-10-18 09:48:30
Is the where syntax wrong?