Hi,
I was wondering if it's possible to have 2 'while' statements using the same 'mysql_query'?
I'm using a jquery thumb gallery with the results pulled in from a database. The gallery requires that the images are grouped together in an unordered list, with the text/overlayed content grouped together in hidden divs which need to be separate from the unordered list. The reason for doing this is because there are many potential results that could go in here and bringing them in randomly seems to make sense.
Here's the code I'm currently using: 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>