Jump to content

[SOLVED] Order a MySQL query by total


imperialized

Recommended Posts

Ok, here is my problem.. I'm tryin to run a top 10 for a website I am working on, however, the display is incorrect.

 

		$top_10 = @mysql_query("SELECT * FROM poker_users ORDER BY chips DESC LIMIT 10");
	while($x = mysql_fetch_array($top_10)) {
		$xname = $x['poker_name'];
		$chips_total = $x['chips'];
		 print "<tr>
		 <td width=75><b><a href=\"#\" onClick=\"ajax('content','profile.php?account=$xname')\">$xname</a></b> </td>
		<td>$chips_total </td>";
		 print "</tr>";
	}

 

Outputs this:

Top 10 Players:

David 997015289

CritEater 875

Chris 1767

XxCassi16xX 11700

Admin 102979237

David1 1000

TChip 1000

NickieJ 1000

Criswell 1000

david23 1000

 

Its obvious what the problem is.. I just don't know how to solve it..

Link to comment
https://forums.phpfreaks.com/topic/146471-solved-order-a-mysql-query-by-total/
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.