prepare("SELECT b.bet, u.username FROM bets b JOIN users u ON b.uid = u.uid ORDER BY b.bet DESC LIMIT 10;"); $stmt->execute(); $result = $stmt->get_result(); $bets = $result->fetch_all(MYSQLI_ASSOC); $stmt->close(); // Top 10 wins $stmt = $conn->prepare("SELECT b.win, u.username FROM wins b JOIN users u ON b.uid = u.uid ORDER BY b.win DESC LIMIT 10;"); $stmt->execute(); $result = $stmt->get_result(); $wins = $result->fetch_all(MYSQLI_ASSOC); $stmt->close(); // Top 10 users by money $stmt = $conn->prepare("SELECT * FROM users ORDER BY money DESC LIMIT 10"); $stmt->execute(); $result = $stmt->get_result(); $users = $result->fetch_all(MYSQLI_ASSOC); $stmt->close(); ?>
| # | Player | Earnings |
|---|---|---|
| = $index + 1 ?> | = htmlspecialchars($user['username']) ?> | = htmlspecialchars($user['money']) ?> |
| # | Player | $bet): ?> |
|---|---|---|
| = $index + 1 ?> | = htmlspecialchars($bet['username']) ?> | = htmlspecialchars($bet['bet']) ?> |
| # | Player | Earnings |
|---|---|---|
| = $index + 1 ?> | = htmlspecialchars($win['username']) ?> | = htmlspecialchars($win['win']) ?> |