Display last uploaded image
<p>I working on an image gallery with the thumbnails and main image on the same page. I have ordered the thumbnails so that the last uploaded image standing on top but I also want that this image is displayed as main image. My site is <a href="http://www.robcnossen.nl/view_album.php?album_id=7" rel="nofollow">http://www.robcnossen.nl/view_album.php?album_id=7</a></p>

<p>I can't find if it can be done with mysql but maybe I am looking right.
I'm trying to find the solution in PHP but all what I find on internet I can't get it working for me. </p>

<p>I thought that array multisort, filectime and ksort would solve my problem but nothing changed.
A part of my code is;</p>

<pre><code>print_r ($images);
//$dirname = dirname(__FILE__);
//filectime($dirname);
//ksort($images);
array_multisort($images, SORT_DESC);
if(isset($image['album'], $image['id'], $image['ext']));     
    $foto = 'uploads/' . $image['album'] . '/' . $image['id'] . '.' . $image['ext'].   '';

$standaardwaarde=isset($_GET['image_id']) ? $_GET['image_id'] :$foto;

echo'&lt;img src="' ,htmlentities($standaardwaarde), '" title="" /&gt;'; 
</code></pre>

<p>How can the last uploaded image be shown as main image?</p>
