Skip to content

Commit

Permalink
🚗新增尝试次数
Browse files Browse the repository at this point in the history
  • Loading branch information
arcxingye committed Dec 23, 2021
1 parent bd68294 commit ca9c26e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions rank.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@
$data_stmt->bind_param("ii", $offset, $num);
$data_stmt->execute();
$data_stmt->store_result();
$data_stmt->bind_result($id, $score, $name, $time, $systeminfo, $area, $message);
$data_stmt->bind_result($id, $score, $name, $time, $system, $area, $message, $attempts);
while ($data_stmt->fetch()) {
$rank += 1;
echo "<a href='#' class='list-group-item list-group-item-action'><div class='d-flex w-100 justify-content-between'>
<h5 class='mb-1'>" . $rank . "" . $name . "</h5><small>" . $time . "</small></div><p class='mb-1'>SCORE: " . $score . " -" . $systeminfo . " -" . $area . "</p>
<h5 class='mb-1'>" . $rank . "" . $name . "</h5><small>" . $time . "</small></div>
<p class='mb-1'>SCORE: " . $score . " TRY:" . $attempts . " -" . $system . " -" . $area . "</p>
<small>" . ($message ? $message : "这个人很懒什么也没留下") . "</small></a>";
}
$data_stmt->close();
$data_stmt->close();
}
?>
<nav aria-label="Page navigation example" style="margin-bottom:3em;">
Expand Down Expand Up @@ -98,13 +99,13 @@
<?php
if ($CurrentUser) {
//查询当前名字历史记录
$score_sql = "SELECT score,time FROM " . $ranking . " where name=?";
$score_sql = "SELECT score,time,attempts FROM " . $ranking . " where name=?";
$score_stmt = $link->prepare($score_sql);
$score_stmt->bind_param("s", $CurrentUser);
$score_stmt->bind_result($score, $time);
$score_stmt->bind_result($score, $time, $attempts);
$score_stmt->execute();
while ($score_stmt->fetch()) {
echo "<footer class='fixed-bottom container'><div class='row shadow bg-info rounded'><div style='padding:0.2em 1em;'>" . $CurrentUser . " 的最新记录<br/>" . "SCORE:" . $score . " " . $time . "</div></div></footer>";
if ($score_stmt->fetch()) {
echo "<footer class='fixed-bottom container'><div class='row shadow bg-info rounded'><div style='padding:0.2em 1em;'>" . $CurrentUser . " 的最高记录 已上传".$attempts."<br/>" . "SCORE:" . $score . " " . $time . "</div></div></footer>";
}
$score_stmt->close();
} else {
Expand Down

0 comments on commit ca9c26e

Please sign in to comment.