Web Analytics Made Easy -
StatCounter PHP MySQL leaderboard - CodingForum

Announcement

Collapse
No announcement yet.

PHP MySQL leaderboard

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP MySQL leaderboard

    I have two MySQL tables, one table stores all the members and one stores goals and who scored them etc. When someone reports a score on my league site and they enter statistics it inserts goals into the goals table. I am trying to code a script which gets the top 5 goal scorers from the table. How would I go about doing this?

    Any help would be appreciated
    Thanks.

  • #2
    PHP Code:
    $query mysql_query("SELECT * FROM goalstable WHERE goals > '0' ORDER BY goals DESC LIMIT 5");

    while (
    $row mysql_fetch_array($query)) {
    echo 
    "".$row['goals']."<br />

    Something to that nature, it will show the top 5, starting with the highest goals.
    Been a sign maker for 8 years. My business:
    American Made Signs

    Comment


    • #3
      Thank you.

      Comment


      • #4
        I am trying to code a script for a leaderboard for my site too. Having trouble. Cant figure out how to post a new thread...

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎