Stuart,

Why not just put everything in a single table and just pull the records out
by one query that uses a "GROUP BY" clause? Much simpler, faster and
effective. If you don't want to do that try replacing "StringList" with an
'i' in your query.

<cfset stringList =
"Employment,Accommodation,Entertainment,LoveConnections,NoticeBoard">

<cfloop from="1" to="#StringList#" index="i">
<CFQUERY NAME="Get#i#Postings" DATASOURCE="020">
        SELECT *
        FROM #i#
        WHERE UserListID = #URL.ViewID#
</CFQUERY>
</cfloop>

cheers

Jordan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Stuart Kidd
Sent: Saturday, 12 July 2003 2:06 PM
To: CFAussie Mailing List
Subject: [cfaussie] Loop Array Thingy


Hi guys,

I'm trying to create a loop for a query below.  Instead of doing 5
queries I'd like to do just one loop.

Can anyone point out what I am doing wrong.  How do I tell the process
to loop from the beginning stringList to the last?

<!--- this is the list containing tables names--->
<cfset stringList =
"Employment,Accommodation,Entertainment,LoveConnections,NoticeBoard">

<cfloop from="1" to="#StringList#" index="i">
<CFQUERY NAME="Get#StringList#Postings" DATASOURCE="020">
        SELECT *
        FROM #StringList#
        WHERE UserListID = #URL.ViewID#
</CFQUERY>
</cfloop>

Thanks,

Saturday



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to