According to LiveDocs for cfoutput in cf7:
When you specify a query attribute, this tag loops over the query rows and produces output for each row within the range specified by the startRow and maxRows values
I'm trying to grab the names of the files in a directory. I use a cfdirectory to get a query record then query the query with cfquery. My cfoutput loops the number of rows of the query, but lists the same file name each time:
output:
code:
<!-- list files in pass-fail directory -->
<cfset fileLocation = "c:\YouTubeUploader\pass-fail">
<cfdirectory
action = "list"
directory = "#fileLocation#"
name = "files"
> <!-- master query -->
<cfdump var="#files#" label="files in pass-fail" >
<!-- displays the query record set returned from cfdirectory -->
<!-- detail query generates a new query result set - the names of the files -->
<cfquery dbtype="query" name="detail">
SELECT files.name
FROM files
</cfquery>
<!-- output all file names -->
<cfoutput query="detail" startRow = "1"
maxRows = "5">
#files.Name#<br>
</cfoutput>
Why is cfoutput staying on that one file name?