It doesn't like that. Comes back with an error in the SQL ..

SQL    select * from tblindexpics where id IN 5,5

Regards - Paul



From: "Robertson-Ravo, Neil (RX)" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: RE: [ cf-dev ] A new problem ???
Date: Wed, 8 Sep 2004 17:09:19 +0100

<cfquery  name="views" datasource="#application.DSN#">
        select *
        from tblindexpics
        where id IN #(pictoget)#
</cfquery>



-----Original Message-----
From: Paul Swingewood [mailto:[EMAIL PROTECTED]
Sent: 08 September 2004 17:03
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] A new problem ???

Can anyone help me with the logic for this one please ...

I have a table which has n number of pics in it....
I want to select 5 random pics (making sure that none are the same)
and then display them on the screen.

I have this muddled up code so far ....

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

<cfset piclist="">
<cfloop index = "LoopCount" from = "1" to = "5">
        <cfoutput query="GetPics">
                <cfset piclist=listappend(piclist,#id#)>
        </cfoutput>
        <cfset picnumber=randrange(1,listlen(piclist))>
        <cfset
pictoget=listappend(listgetat(piclist,picnumber),#LoopCount#)>
</cfloop>

<cfquery  name="views" datasource="#application.DSN#">
        select *
        from tblindexpics
        where id = #(whatgoes her??)#
</cfquery>

I've lost the plot completely and am confused as to what loop goes where,
when & why.

Regards - Paul



--
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]
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540. It contains information which is
confidential and may also be privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful. If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910. The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com


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