I am sure there is a custom tag in the gallery for it however:

Establish the list variables at first:
<cfset namelist="">
<cfset idlist="">
<cfset titlelist="">

Then execute the query:
<CFQUERY NAME="getOptinfo" DATASOURCE="#ACBMainDS#">
     SELECT ID, Title, Name
     FROM Options
</CFQUERY>

The output query to list:
<CFOUPUT QUERY="getOptinfo">
        <cfset namelist=#ListAppend(namelist,getOptinfo.name)#>
        <cfset idlist=#ListAppend(idlist,getOptinfo.id)#>
        <cfset titlelist=#ListAppend(titlelist,getOptinfo.title)#>
</CFOUTPUT>

-----Original Message-----
From: Ethan Rosch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 10:47 AM
To: CF-Talk
Subject: query result to list


Hi all,

what's the easiest way to get the outut of a query into a list?

ex.

<CFQUERY NAME="getOptinfo" DATASOURCE="#ACBMainDS#">
     SELECT ID, Title, Name
     FROM Options
 </CFQUERY>

and I want to access the resulting Names as a list?

List(rob,ray,eddie,eagle)

thanks,

s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to