yup! - That seems to work ok.

Thanks a lot - Can't say I really understand how all that works but it seems to do what I wanted

Regards - Paul


From: "Stephen Moretti (cfmaster)" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] A new problem ???
Date: Wed, 08 Sep 2004 17:15:25 +0100


<cfquery name="GetPics" datasource="#application.DSN#"> select * from tblindexpics order by ID desc </cfquery> <cfset PicIDList = ValueList(GetPics.ID)>

<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>


Errr.... I haven't tested it, so watch that CFLOOP Condition="NOT UniquePicID", but it should be about right.


Stephen


--
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]




-- 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]



Reply via email to