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
https://forums.phpfreaks.com/topic/57015-solved-order-by-problem-s/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.