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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -