forked from SeeTurtle-team/WebServerPrograming_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrank.php
More file actions
66 lines (49 loc) · 1.71 KB
/
rank.php
File metadata and controls
66 lines (49 loc) · 1.71 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ranking</title>
<link rel="stylesheet" href="login.css">
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<section class="login-form">
<h1></h1>
<div class="bar_logo">
<a href="index.php">Ranking</a>
</div>
<?php
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");//공백란에 디비 비번 입력
$sql ="select * from member order by recommend desc limit 3";
$result = mysqli_query($con,$sql);
$num_result= $result->num_rows;
for($i=0; $i<$num_result; $i++){
$row = $result->fetch_assoc();
$name = $row['UserId'];
$recommend = $row['recommend'];
if($i==0){
$grade = "1st 추천 수 : ".$recommend;
}
if($i==1){
$grade = "2nd 추천 수 : ".$recommend;
}
if($i==2){
$grade = "3rd 추천 수 : ".$recommend;
}
echo "
<div class=\"int-area\">
<input type=\"submit\" name=\"id\" id=\"id\"
autocomplete=\"off\" value= \"$name\">
<label for=\"id\">$grade</label>
</div>
";
}
?>
<div class="btn-area">
<button type="submit" onclick="location.href='index.php'">Back</button>
</div>
</section>
</body>
</html>