php - MySQL - cannot order by value -


so want order values in database highest lowest. thing randomly scramble results, meaning puts 100 below 50 in middle , 1 in top.

<?php $con=mysqli_connect("localhost","username","password","table"); // check connection if (mysqli_connect_errno()) {   echo "failed connect mysql: " . mysqli_connect_error(); }  $result = mysqli_query($con,"select * playerdata order gold");  while($row = mysqli_fetch_array($result)) {   echo $row['username'];   echo " " . $row['gold'];   $row['unique_id'];   echo "<br>"; }  mysqli_close($con); ?> 

select * playerdata order gold desc


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -