Ok this all works fine and the client lioves it. Now of course whe wants a
change. There are n no of pics in the table which she now wants 'grouping'.
The idea is that when the images are randomly selected the five shown are
all from the same group. So lets say there are n groups. I guess it would
work something like this .....
Randomly select a group.
Now select five random images from that group only
display the images
How do I adjust the code earlier to achieve this
<cfquery name="GetPics" datasource="#application.DSN#">
select *
from tblindexpics
order by ID desc
</cfquery>
<cfset PicIDList = ValueList(GetPics.ID)> <!--- Don't need this ?? --->
<cfset piclist="">
<cfloop index = "LoopCount" from = "1" to = "5">
<cfset UniquePicID = false>
<cfloop condition="NOT UniquePicID">
<cfset picnumber=randrange(1,GetPics.RecordCount)>
<cfset picID = GetPics["ID"][picnumber]>
<cfif NOT ListFind(piclist,picID)>
<cfset UniquePicID = True>
<cfset piclist = ListAppend(piclist,picid)>
</cfif>
</cfloop>
</cfloop>
<cfquery name="views" datasource="#application.DSN#">
select *
from tblindexpics
where id IN (#piclist#)
</cfquery>
--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by
activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]