Jump to content

[SOLVED] ORDER BY problem :S


zampu

Recommended Posts

Hello, ive made a  script to order the players in my game by money, and its not working.  Please help

<?php
session_start();
include_once "includes/db_connect.php"; include_once "includes/functions.php"; logincheck();
  print "<tr valign='top'><td width=25%>";
  print "</td>";
  print "<td width=100%>";
  //main table
  $getscores="SELECT money,username from users ORDER BY money ASC limit 25";
  $getscores2=mysql_query($getscores) or die("Could not get scores");
  $rank=1;
  print "<center><h3>Top 25 players</h3></center><center>";
  print "<table width=90% class='maintable'><tr><td>Rank</td><td>Name</td><td>NetWorth</td></tr>";
  while($getscores3=mysql_fetch_array($getscores2))
  {
     $getscores3[username]=strip_tags($getscores3[username]);
     print "<tr><td>$rank</td><td>$getscores3[username]</td><td>$$getscores3[money]</td></tr>";
     $rank++;
  }
  print "</table></center><br><br>";
?>

 

Its getting all of the info, and making the table, and listing it.  Its just not ordering it by "money"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.