首页 > 问答 > 正文
/***
* 获取用户名
*/
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要给出查询的字段,列如where('id',$admin_id)
Summer2018-10-18 09:52:26
首先要看你的$user_name有没有拿到值;然后看
胤彬-2018-10-18 09:48:30
where语法错了吧