View Single Post
Old 07-01-2009, 10:51 PM   PM User | #1
loki421
Regular Coder

 
Join Date: Feb 2009
Location: Worcester
Posts: 172
Thanks: 13
Thanked 6 Times in 6 Posts
loki421 is an unknown quantity at this point
How to loop though db and return from csv?

Hi all!

I've got a CSV that i'd like to loop a query on.

Here's what i've got so far:
Code:
<cfargument  name="myString" type="string" required="yes">
			
<cfset myCSVlist="#arguments.myString#">
			
	<cfloop index="i" list="#myCSVlist#">

            <cfquery name="qData" datasource="#dsn#">
            	SELECT *
		FROM myTable
		WHERE column3  = '#myCSVlist#'
            </cfquery>

	</cfloop>
		
	<cfoutput query="qData">
           #qData.column1#, <br/>
           #qData.column2#,<br/> 
           #qData.column3#<br/>
       </cfoutput>
But this only returns one result from the db, how can i take those results and build an array from then that i can return to Flex?

Any help or pointers will be gratefully recieved


Thanks in advance all!
loki421 is offline   Reply With Quote