Getting total of 'location'
<p>In my database I have a table entitled <code>db_pilots</code>, and I'm trying to find the total of pilots from country i.e a total of pilots from <code>GB</code>. It's doing just that, but it's sorting by <code>location</code> and not the <code>total</code>. How can I achieve this?</p>

<pre><code>&lt;?php
$country_info = DB::get_results('SELECT COUNT(pilotid) as total, location FROM'.TABLE_PREFIX.'pilots GROUP BY location DESC');

foreach($country_info as $country)
{

?&gt;
    &lt;tr&gt;
        &lt;td align="center"&gt;&lt;img src="&lt;?php echo Countries::getCountryImage($country-&gt;location); ?&gt;" /&gt;&lt;/td&gt;
        &lt;td align="center"&gt;&lt;?php echo Countries::getCountryName($country-&gt;location); ?&gt;&lt;/td&gt;
        &lt;td align="center"&gt;&lt;?php echo $country-&gt;total;?&gt;&lt;/td&gt;
    &lt;/tr&gt;

&lt;?php
}
?&gt;
</code></pre>
