Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all articles
Browse latest Browse all 5979

How to output cfquery to array?

$
0
0

Hello everyone,

I'm trying to output my cfquery to array. I need something like this:

 

[code]

<cfset myarray=arrayNew(2)>

<cfloop query="qryCustomers">

     <cfset myarray = [{"CustomerID":ID,"Name":FirstLast}]>

</cfloop>

[/code]

 

I tried this code but that did not work. Error always indicate that something is wrong in my cfset where I have my ID and Customer name together. I'm not sure either if I can do this in cold fusion. I have to put these to values together because I have to use them later to compare with other values from second query. If anyone can tell me what is wrong in my code I would appreciate that. Thanks in advance.


Viewing all articles
Browse latest Browse all 5979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>