I am trying to show a thumbnail photo of a painting beside a country name on an art website, but want the photo to be different everytime someone goes to the page.
I have trawled the previous posts on this and come up with the following:
<?php
$sql = "SELECT * FROM galleryTable WHERE tour = '$Italy' ORDER BY RAND() LIMIT 0,1";
$result = mysql_query( $sql, $link );
while ( $newArray = mysql_fetch_array($result) )
{
$name = $newArray['name'];
$tupload = $newArray['tupload'];
print "
<a href=\"gallery.php?page=Italy\"><img src=\"/images/archive/$tupload\"></a>
<p class=smalltext>$name</p>
";
}
mysql_close( $link );
?>
Any help much appreciated!!!
Rupert