Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 890
  • Last Modified:

coldfusion query string list

Hi,

I want to run a cfquery, the through all the value results into a variable.  Something like below.  

I'm just drawing a blank as to how to do this (b/c I have 15 other 'urgent' things and jetlag.

Thanks!


<cfquery name="List" datasource="#REQUEST.dsn#">
select name_tbl, id_tbl, sid_tbl
from tbl
</cfquery>
 
<!---the values from the query are 1,2,3,4,5--->
 
<cfset Values=#list.sid_tbl>
 
<cfoutput>#values#</cfoutput> ----- this would display as:  1,2,3,4,5

Open in new window

0
wkolasa
Asked:
wkolasa
  • 2
2 Solutions
 
duncancummingCommented:
<cfset values = ValueList(List.sid_tbl)>

0
 
wkolasaAuthor Commented:
Nevermind - got it as soon as I typed it (I'm tired):

<cfset values = #valueList(List..sid_tbl)#>
0
 
wkolasaAuthor Commented:
Oh, hey Duncan... didn't notice you posted (and so fast).  Thanks much!
0
 
_agx_Commented:
wkolasa,

Just fyi, you really don't need to use # signs with expressions like that.  
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now