Hi,
I am using the following code to fetch 6 random images from all the albums located in one gallery, but sometimes I am getting 3 random images, sometimes 4 and soon. It is not always 6 random images.
What I am doing wrong?
function GalleryImages() {
$gallery = DataObject::get_one("ImageGalleryPage");
$items = DataObject::get("ImageGalleryItem","ImageGalleryPageID = {$gallery->ID}","RAND()",null,6);
return $gallery->GalleryItems(null,$items);
}