connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// データを取得
$sql = "SELECT user_id, user_name, tact_number, game_level, game_number, game_name, is_correct, play_end_time FROM game_scores_tact ORDER BY play_end_time DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "
";
echo "ユーザーID | ユーザー名 | TACTナンバー | ゲームレベル | ゲーム番号 | ゲーム名 | 正誤 | プレイ終了時間 |
";
while($row = $result->fetch_assoc()) {
echo "";
echo "" . htmlspecialchars($row["user_id"]) . " | ";
echo "" . htmlspecialchars($row["user_name"]) . " | ";
echo "" . htmlspecialchars($row["tact_number"]) . " | ";
echo "" . htmlspecialchars($row["game_level"]) . " | ";
echo "" . htmlspecialchars($row["game_number"]) . " | ";
echo "" . htmlspecialchars($row["game_name"]) . " | ";
echo "" . ($row["is_correct"] == 1 ? "○" : "×") . " | ";
echo "" . htmlspecialchars($row["play_end_time"]) . " | ";
echo "
";
}
echo "
";
} else {
echo "結果がありません";
}
$conn->close();
?>