opps i forgot to put this option.. without an array in the structure <cfscript> MyStruct=StructNew(); MyStruct.ProductID=valueList(QueryName.ProductID,","); </cfscript>
-----Original Message----- From: Joe Eugene [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 01, 2002 11:25 PM To: CF-Talk Subject: RE: Query resuts into structure If you just want add ONE Product id into a structure? <cfscript> MyStruct=StructNew(); MyStruct.ProductID=QueryName["ColumnName"][1]; ///[1] is the row returned from the query </cfscript> <cfoutput> #MyStruct.ProductID# </cfoutput> will give you the results... now if you want add multiple Product ids into the structure, create an array in the structure.. <cfscript> MyStruct=StructNew(); MyStruct.ProductID=ArrayNew(1); </cfscript> <cfloop query="MyProducts"> <cfset MyStruct.ProductID[currentRow]=QueryName["ColumnName"][currentRow]> </cfloop> Joe Certified Advanced ColdFusion Developer [EMAIL PROTECTED] -----Original Message----- From: James Mathieson [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 11:44 AM To: CF-Talk Subject: Query resuts into structure Easy question for the gurus. I have a query that grabs a set of products associated with an ID (to autofill a cart for a person's renewal) - product_code, description, cost (quantity not needed on this part, as you wouldn't want to join twice at once). I've been hunting the CFWACK and the Studio help, but I'm lost as to how to stick the results into a structure. I'll admit, this is my first stab at creating structures & such, so I'm probably just thick. Is it a case of looping over the query results and sticking them in, or what? going crazy over simple things on a Friday.... Cheers & thanks, James James Mathieson Information Systems Manager The Wildlife Society 5410 Grosvenor Lane Bethesda, MD 20814-2197 PH: 301-897-9770 Fax: 301-530-2471 [EMAIL PROTECTED] http://www.wildlife.org/ ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists