خرید بک لینک

Vote count: 0

I've searched everywhere including Stackoverflow for my answer and couldn't find the exact information's I was looking for. Like I've tried those answer's in other sites and some answer's here at StackOverFlow and it didn't work.

The problem is that I am working on a project where displaying the highest reputation by top ten (aka: "Leaderboards/Charts") but keep getting low (first) and then random (eg: low, high, low, medium) based on reputation. It's weird, I'm not experienced in SQLi commands, so call me a noob (I'll accept).

Here's the code I have currently written that doesn't work:

<h1>Leaderboards</h1>
<?php
$query = "SELECT user_name, reputation FROM m_users ORDER BY reputation DESC LIMIT 10";
?>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            top ten
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>User</th>
                                            <th>Reputation Points</th>
                                        </tr>
                                    </thead>
                                    <tbody>
<?php
foreach($mysqli->query($query) as $rep)
{
    echo '<tr>';
        echo '<td>';
            echo ''.$rep['user_name'].'';
        echo '</td>';
        echo '<td>';
            echo $rep['reputation'];
        echo '</td>';
    echo '</tr>';
}
?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

The results that comes up is:

jay 100
ray 1000
joy 250

What I want is: "Highest to Lowest" (simple chart/leaderboard), like for example: "In some online gaming multiplayer like Call of Duty, it shows the highest to lowest by scores...etc". This just results in lowest, highest, lowest, medium...etc.

I can't fix this at all, can anyone help me detect the bug? :(

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 20 فروردين 1395 ساعت: 10:41

صفحه بندی