title: using PHP script for sorting sql database entries
body: <p>I need some help sorting my score value's of my sql database</p>
  
  <pre><code>    &lt;table border = '2'&gt;
      &lt;?php
  
      $con = mysql_connect("localhost", "root", "");
      if(!$con)
      {
          echo "Could not establish connection to the database " . mysql_error();
      }
  
      $mydb = mysql_select_db("users", $con);
      if (!$mydb)
      {
          echo "Error selecting database " . mysql_error();
      }
  
      $mystatement = mysql_query("SELECT * FROM people");
      $dbcount = mysql_num_rows($mystatement);
      $selection = array(0 =&gt; "");
      $nameselection = array(0 =&gt; "");
  
      $i = 0; 
          while ($row = mysql_fetch_array($mystatement))
          {
          $selection[$i] = $row['score'];
          $nameselection[$i] = $row['username']; 
          //echo "&lt;tr&gt; &lt;td&gt;$row[username]&lt;/td&gt; &lt;td&gt;$row[score]&lt;/td&gt;&lt;/tr&gt;";
          $i++; 
          }
  arsort($selection);
  ksort($nameselection);
  
  for ($x = 0; $x &lt; $dbcount; $x++)
  {
      echo "&lt;tr&gt; &lt;td&gt;$nameselection[$x]&lt;/td&gt; &lt;td&gt;$selection[$x]&lt;/td&gt; &lt;/tr&gt;"; 
  }
  
  
      ?&gt;
  
      &lt;/table&gt;
  </code></pre>
  
  <p>im trying to post the user's scores from my game to a table, sorting them from highest to lowest. I'm just stuck..</p>