How do I get this PHP script to sort Descending?
<pre><code> &lt;?php
echo "&lt;table style='border: solid 1px black;'&gt;";
echo "&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Experience&lt;/th&gt;&lt;/tr&gt;";

class TableRows extends RecursiveIteratorIterator { 
    function __construct($it) { 
        parent::__construct($it, self::LEAVES_ONLY); 
    }

    function current() {
        return "&lt;td style='width:150px;border:1px solid black;'&gt;" . parent::current(). "&lt;/td&gt;";
    }

    function beginChildren() { 
        echo "&lt;tr&gt;"; 
    } 

    function endChildren() { 
        echo "&lt;/tr&gt;" . "\n";
    } 
} 

$servername = "xxxx";
$username = "xxxxx";
$password = "xxxxx";
$dbname = "xxxxxx";

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $stmt = $conn-&gt;prepare("SELECT Name, sum(Experience) FROM Hunters GROUP BY Name         ORDER BY Experience DESC"); 
    $stmt-&gt;execute();

    // set the resulting array to associative
    $result = $stmt-&gt;setFetchMode(PDO::FETCH_ASSOC); 
    foreach(new TableRows(new RecursiveArrayIterator($stmt-&gt;fetchAll())) as $k=&gt;$v) { 
        echo $v;
    }
}
catch(PDOException $e) {
    echo "Error: " . $e-&gt;getMessage();
}
$conn = null;
echo "&lt;/table&gt;";
?&gt;
</code></pre>

<p>I've tried to get this to sort by Experience Descending, but it just won't do it. I'm not sure how to make it. Any help would be greatly appreciated. This is for displaying experience points. </p>