I got really good results by caching the list I'm comparing inside the loop of the
first. The inside query never changes so there's no need to re-run it. the 5-second
cache is way more than whats really needed:
<CFLOOP QUERY="GotGroups">
<!--- Does the current user have the necessary group privileges? --->
<CFQUERY
NAME="UserGroupHunt"
DATASOURCE="#request.SiteDSN#"
CACHEDWITHIN="#CreateTimeSpan(0,0,0,5)#">
SELECT
cm_users_groups.ParentID
FROM cm_users_groups
WHERE
cm_users_groups.GroupName='#GotGroups.GroupName#'
AND
cm_users_groups.ParentID=#request.LocalProducer#
ORDER BY cm_users_groups.ID
</CFQUERY>
<CFIF UserGroupHunt.RecordCount GT 0 AND NOT Compare(caller.GroupFound,"NO")>
<CFSET caller.GroupFound = "YES">
</CFIF>
</CFLOOP>
---------------------------------------
Matt Robertson [EMAIL PROTECTED]
MSB Designs, Inc., www.mysecretbase.com
---------------------------------------
---------- Original Message ----------------------------------
from: Tony Schreiber <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Thu, 20 Jun 2002 15:28:28 -0400 (EDT)
Is there an easy way to see if any items in two lists match?
For now, I'm looping over one list and doing listfind on the other for
each value from the first. But I didn't know if there was an easier way.
Tony Schreiber, Senior Partner Man and Machine, Limited
mailto:[EMAIL PROTECTED] http://www.technocraft.com
http://www.simplemessageboard.com ___Free Forum Software for Cold Fusion
http://www.is300.net ___________The Enthusiast's Home of the Lexus IS300
http://www.digitacamera.com ______________DigitA Camera Scripts and Tips
http://www.linklabexchange.com _____________Miata Link ECU Data Exchange
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists