-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_table.php
74 lines (61 loc) · 1.38 KB
/
admin_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>管理员列表</title>
<style>
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
background-color: rgb(173, 169, 129);
}
.head {
text-align: center;
font-family: Microsoft Yahei;
font-size: 60px;
font-weight: bold;
color: white;
height: 40%;
}
table {
text-align: center;
margin: 0px auto;
border: 5px double;
width: 35%;
}
a {
color: white;
font-size: 20px;
}
.bottom {
text-align: center;
}
.back {
text-align:center;
}
</style>
</head>
<body>
<?php
$mysqli = mysqli_connect("localhost", "root", "", "library");
echo "<div class='head'><br>查询结果</div>";
$str = "SELECT adminname,level FROM admin ORDER BY level DESC";
echo "<table border='4px' cellpadding='15px' cellspacing='0px'>";
echo "<tr><td>管理员用户名</td><td>权限等级</td></tr>";
if ($res = mysqli_query($mysqli, $str)) //这个和mysql_query参数有一定的顺序差别,这个用不了反过来就行
{
while ($row = mysqli_fetch_row($res)) {
echo "<tr><td>$row[0]</td><td>$row[1]</td><tr>";
}
}
echo "</table>";
echo "<div class='back'><a href='main.su.php'><br>回到首页</a></br></div>";
mysqli_close($mysqli); //还差美化界面
?>
</body>
</html>