Hi folks 
I have a horizontal bar on my website that produces 7 different images from a database and instead of only letting the visitors see the first 7 images I would like them to see all them, so I've been trying to see if I make the array randomly generate the images every time the page is loaded.
The current code is as follows:
Is there a relatively simple way of doing this?
Thanks

I have a horizontal bar on my website that produces 7 different images from a database and instead of only letting the visitors see the first 7 images I would like them to see all them, so I've been trying to see if I make the array randomly generate the images every time the page is loaded.
The current code is as follows:
Code:
echo "<table border='0' cellpadding='0' cellspacing='4'>\r\n";
$top_row = "";
$bottom_row = "";
$counter = "";
while($counter <= 6 && $villa = mysql_fetch_array($villas))
{
$counter++;
$villaid = $villa['villaid'];
$thumbnail = $villa['thumbnail'];
$categoryid = $villa['categoryid'];
$name = $villa['name'];
$thumbnail = htmlspecialchars($villa['thumbnail']);
$categoryid = htmlspecialchars($villa['categoryid']);
$name = htmlspecialchars($villa['name']);
$top_row .= "<td class='villas-top'>";
$top_row .= "<a href='index.php?page=villapage&villaid=$villaid'>";
$top_row .= "<img alt='$name Thumbnail' width='75px' height='70px' src='$thumbnail' /></a></td>\r\n";
$bottom_row .= "<td class='villas-bottom'><a style='color: #ffffff; background-color: #0e5e9c; text-decoration: none;' title='$categoryid Bedrooms' href='index.php?page=villapage&villaid=$villaid'>$categoryid Bedrooms</a></td>\r\n";
}
echo "<tr>\r\n$top_row</tr>\r\n";
echo "<tr>\r\n$bottom_row</tr>\r\n";
echo "</table>";
Is there a relatively simple way of doing this?
Thanks
