Jump to content

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

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.