php - Printing table values in ascending order -


i trying print out users name , totalspent value in ascending order of totalspent. i.e, user has spent outputed first next highest spender etc.

this current code, however, seems output single table row infinite amount of times.

$query = "select * ( select * `members` order `totalspent` desc limit 10) tmp order tmp.totalspent asc";  $result = $mysqli->query($query);  while ($row = $result->fetch_assoc()) {     echo $row['name'] . " - $" . $row['totalspent'] . "<br/>"; } 

select member_name, totalspent tmp order totalspent desc;

still can show snippet of table , snippet of answer desire


Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -