// 判断是否登录
if(empty($_COOKIE[‘admin‘]) || !isset($_COOKIE[‘admin‘])){
header("location:login.php");
}
// <!-- 查询管理员 -->
$id = $_COOKIE[‘admin‘];
$conn = new mysqli(‘localhost‘,‘root‘,‘root‘,‘qwer‘);
$sqe = "select * from wer where id = $id";
$res = $conn->query($sqe);
// 转换成一维数组
$info = $res->fetch_assoc();
// 转化成二维数组
// $liar = $res->fetch_all(MYSQLI_ASSOC);