Hi,
Following on from a previous question, shown here, I was wondering how I would go about changing the code below into 'foreach' statements? Any help greatly appreciated, S.
<div id="banner-wrap">
<div id="banner" class="gallery">
<ul class="galleryBar">
<?php
$homeB=mysql_query("select * from istable where fpGallery = '1' ORDER BY RAND() LIMIT 0, 5");
while($homeG=mysql_fetch_array($homeB)) {
$linkcode = $homeG['title'];
$linkcode = str_replace(" ","",$linkcode);
echo '
<li>
<a href="'.$wwwUrl.'images/'.$homeG['image'].'" rel="'.$linkcode.'">
<img src="'.$wwwUrl.'images/tn/'.$homeG['image'].'" width="75" height="55" alt="'.$homeG['title'].'" />
</a>
</li>
';
}
echo '</ul>';
echo '</div>';
while($homeGal=mysql_fetch_array($homeB)) {
echo '
<div id="'.$linkcode.'" class="overlay">
<h3>'.$homeGal['title'].'</h3>
<h4>'.$homeGal['location'].'</h4>
</div>
';
}
?>
</div>