force number of images
Hey Ray
Have set up a panel in the front end of a site which needs to have 4 images in it:
<?php
$ChildrenPanel = new WA_MySQLi_RS("ChildrenPanel",$DBConnection,4);
$ChildrenPanel->setQuery("SELECT * FROM gallery_category WHERE GalleryPage = 'gallery_1' ORDER BY Rand()");
$ChildrenPanel->execute();
?>
what I am trying to do is force 4 images into the panel (even if it duplicates) even if there are only, for example, 2 images in the db
the rs I have is this and it is only returning , in this case, 2 images:
<?php
while(!$ChildrenPanel->atEnd()) {
?>
<a href="pottery/childrens-parties" class="responsive-picture homepagePanel">
<picture><img alt="" src="./images/gallery_c/<?php echo($ChildrenPanel->getColumnVal("GalleryImage")); ?>" width="231" height="306"></picture>
</a>
<?php
$ChildrenPanel->moveNext();
}
$ChildrenPanel->moveFirst(); //return RS to first record
?>