记分牌系统,php和mysql

时间:2012-04-11 21:10:26

标签: php mysql oop

我查看了很多很多关于如何在结果超出后编制导航链接的指南,比方说25个结果,所以网址栏会有类似的网址./index.php?page=3,并且找不到根据我的代码易于实现的东西:

        <body>
    <div id = 'scoreboardcontainer'>
<?php
    $ranking = mysql_query("SELECT username, points\n"
    . "FROM sector0_players\n"
    . "WHERE points = (SELECT MAX(points) FROM sector0_players WHERE points< (SELECT MAX(points) FROM sector0_players WHERE points <(SELECT MAX(points) FROM sector0_players)))");
?>
            <ul>
                <li><a href="#scoreboard" title = "Point scoreboards">Scoreboards</a></li>
                <li><a href="#Tour_boards" title = "Tournament socreboards" class = "tbr">Tournament</a></li>
            </ul>

            <div id="scoreboard">
                <div class = "scoreboardtitles">
                    <div class = "player_score_rankinfl2">Rank</div>
                    <div class = "player_score_usnamefl2">Username</div>
                    <div class = "player_score_charnamefl2">Character</div>
                    <div class = "player_score_pointfl2">Points</div>
                </div>
                <br />
                <hr />
            <?php
    $scoreboardquery = mysql_query("SELECT * FROM sector0_players ORDER BY points DESC");
    while($scoreboard_fetch = mysql_fetch_array($scoreboardquery)){
?>
                <div class="global_container_score_class"> <!--Start generating from here-->
                    <div class = "scoreboard_1l">
                            <div class = "player_rank">1st</div>
                            <div class = "player_name"><a href = "profile.php?id=<?php echo $scoreboard_fetch['id'];?>"><?php echo $scbdname = $scoreboard_fetch['username'];?></a></div>
                    </div>
                    <div class = "scoreboard_2r">
                            <div class = "player_charname"><?php echo $scbddspname = $scoreboard_fetch['displayname'];?></div>
                            <div class = "player_points"><?php echo $scbdpoints = number_format($scoreboard_fetch['points']);?></div>
                    </div>
                    <div class = "clear"></div>
                </div>
                <?php
                }
                ?>
            </div>

我没有OOP经验,我知道如何编程,但不是为了满足我的需要而修改它。如果这种情况需要OOP,如果有人能为我提供一个学习高级OO的良好开端,我将不胜感激。 如果没有,只需键入我需要实现的内容(除非必要,否则不需要代码)。

1 个答案:

答案 0 :(得分:2)

如果我理解正确,你就是在谈论分页 - 这不一定需要OOP。如果您有兴趣从头开始学习,搜索“php pagination”将产生大量信息:]