Why don't you just CFLOOP over the query? You don't need to convert
the query to a comma list to loop over it...
<CFLOOP query="qry_name")>
...cf code...
</CFLOOP>
Andrew.
----- Original Message -----
From: Mark Henderson <[EMAIL PROTECTED]>
Date: Thu, 23 Sep 2004 21:07:07 +1200
Subject: Converting query to comma separated list
To: CF-Talk <[EMAIL PROTECTED]>
My first question, though I suspect this might not be the best
approach . Is it possible to turn a query (cfdirectory in this case)
into a comma separated list?
The reason I ask is bcos currently I have a hardcoded list of folders
in my action file, and I loop through and pull all the files from
each. Like so...
<cfloop
index = "thisItem"
list = "maps,districtPlans,mgmtPlans">
<cfdirectory
name="getAllFiles"
action="">
directory="#serverdir##thisItem#"
sort="name ASC">
<cfquery dbtype="query" name="getAllFiles_#thisItem#">
SELECT *
FROM getAllFiles
</cfquery>
</cfloop>
and in the display page something like...
<ol>
<cfoutput query="getAllFiles_maps">
#replace(listFirst(name), "_", " ", "ALL")#<br />
</cfoutput>
</ol>
<ol>
<cfoutput query="getAllFiles_mgmtPlans">
#replace(listFirst(name), "_", " ", "ALL")#<br />
</cfoutput>
</ol> etc etc
--------------------
This is all working fine. BUT, instead of hardcoding the list, I can
do another directory call like so...
<cfdirectory
name="getAllFolders"
action="">
directory="#serverdir#"
sort="name ASC">
which will give me all the folders that are in the above list (ie
maps,districtPlans etc). So, how to get the query to a list so I don't
need to hardcode? OR, is this the wrong approach and is it possible to
use the getAllFolders query directly in some fashion?
TIA
Mark________________________________
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Converting query to comma separated list Mark Henderson
- RE: Converting query to comma separated list Andrew Dixon
- RE: Converting query to comma separated list Kola Oyedeji
- Re: Converting query to comma separated list Mark Henderson
- Re: Converting query to comma separated list Andrew Dixon
- Re: Converting query to comma separated list Joe Rinehart
- Re: Converting query to comma separated list Larry Lyons
- RE: Converting query to comma separated list SStewart
- Re: Converting query to comma separated list Joe Rinehart
- RE: Converting query to comma separated list SStewart
- RE: Converting query to comma separated list Mark Henderson