I haven't ever noticed the list option before.

Thanks, it works great.



>try along this line using list=yes in cfqueryparam
>
>select * where id in (<cfqueryparam value="#form.field#" list="yes">)
>
>~Terry 
>
>-----Original Message-----
>From: Bobby Schuchert [mailto:[EMAIL PROTECTED] 
>Sent: Wednesday, April 25, 2007 8:52
>To: CF-Talk
>Subject: Loop a query
>
>I ran out of RedBull so I am slow this morning. 
>
>I have a series on checkboxes in a form. I would like the user to pick
>the checkboxes they want then hit a button to show those respective
>items as labels on a display page. I am having trouble trying to get the
>ids of these items to populate the table row by row. I need to be able
>to loop an array or query on the display page.
>
>Is it bad practice to run a query on each one of those items in the list
>using a loop like so:
>
><cfloop index="i" list="form.checkboxfield"> <cfquery> Select field1,
>field2, field3 from table where field1 = i </cfquery> </cfloop>
>
>Won't that create a database connection for each item in the list? Is
>there an alternative to use that is more efficient?
>
>Thanks.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276212
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
  • RE: Loop a query Bader, Terrence C CTR MARMC, 231
    • Re: Loop a query Bobby Schuchert

Reply via email to