Hi! I'm trying to show 5 random images from my database and i seem to be stuck.
Would appreciate some help or tips.
I obviously dont want any duplicate images. Have tried to figure it out by googling butt my head hurts too much xD
Got thumbnails for the picture and am showing them with lightbox.
Here is the code
$result = mysql_query("SELECT * FROM imgupload");
$count = 1;
$num_rows = mysql_num_rows($result);
echo "<br />";
while ($count<=5)
{
$query = mysql_query("SELECT * FROM imgupload ORDER BY RAND()");
$row = mysql_fetch_row($query);
$kaboom = explode("/",$row[3]);
echo "<a href='$row[3]' rel='lightbox[group]' title='$row[1]');><img src='$kaboom[0]/resized_$kaboom[1]'></a>";
$count = $count + 1;
}