Iterate through a foreach loop backwards in PHP
<p>I have here a foreach loop that displays images from a database onto a webpage. What I would like to do is iterate through the foreach loop backwards, so the latest content is shown first on the webpage. Here is my code:</p>

<pre><code>$sql = "SELECT COUNT(*) FROM 'UPLOADPICS'";

    if ($sth = $dbhandle-&gt;query($sql)){
        if ($sth-&gt;fetchColumn() &gt; 0){
            $sql = "SELECT link FROM 'UPLOADPICS'";
            foreach ($dbhandle-&gt;query($sql) as $row){
                $content = $row['link'];
                ?&gt;
                &lt;img src="&lt;?php echo $content ?&gt;" /&gt;
                &lt;br/&gt;
                &lt;br/&gt;
                &lt;?php
            }
        }

        else {
            print "No rows matched the query";
        }
</code></pre>

<p>Is this possible? Thanks so much in advance!</p>
