if your inside the cfoutput you dont need to do that as the query loop increments the row counter with currentRow, so all you need it evaluate(column) to get the value
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Dale Fraser Sent: Monday, May 22, 2006 12:23 PM To: [email protected] Subject: [cfaussie] Re: How do myQuery["columnName"] ? Well I don't see what's wrong with (2) that's the best way but you could <cfset column = "myColumn"/> <cfloop query="myQuery"> evaluate("myQuery.#column#") </loop> Regards Dale Fraser -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Mandel Sent: Monday, 22 May 2006 12:13 PM To: [email protected] Subject: [cfaussie] How do myQuery["columnName"] ? Hey all, This seems like a stupid question, but I can't seem to figure it If I have a query, called 'myQuery' I can do: (1) <cfloop query="myQuery"> myQuery.column </loop> and it will output fine. I can do: (2) <cfset column = "myColumn"/> <cfloop query="myQuery"> myQuery[column][myQuery.currentRow] </loop> and it will output fine But if I do: (3) <cfset column = "myColumn"/> <cfloop query="myQuery"> myQuery[column] </loop> I get the error: Complex object types cannot be converted to simple values. Is option (2) the only way to handle dynamic column names? I had thought option 3 would work.. but it doesn't seem to... Help? Mark -- E: [EMAIL PROTECTED] W: www.compoundtheory.com ICQ: 3094740 X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.54.63.19 with SMTP id l19mr180118wra; Sun, 21 May 2006 19:28:42 -0700 (PDT) Return-Path: <[EMAIL PROTECTED]> Received: from inevative.com.au ([203.89.195.34]) by mx.googlegroups.com with ESMTP id v11si817243cwb.2006.05.21.19.28.40; Sun, 21 May 2006 19:28:42 -0700 (PDT) Received-SPF: neutral (googlegroups.com: 203.89.195.34 is neither permitted nor denied by best guess record for domain of [EMAIL PROTECTED]) Received: from webguru ([210.11.88.61]) by inevative.com.au with MailEnable ESMTP; Mon, 22 May 2006 12:22:37 +1000 From: "Steve Onnis" <[EMAIL PROTECTED]> To: <[email protected]> Subject: RE: [cfaussie] Re: How do myQuery["columnName"] ? Date: Mon, 22 May 2006 12:32:50 +1000 Message-ID: <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: text/plain X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <[EMAIL PROTECTED]> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Importance: Normal if your inside the cfoutput you dont need to do that as the query loop increments the row counter with currentRow, so all you need it evaluate(column) to get the value -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Dale Fraser Sent: Monday, May 22, 2006 12:23 PM To: [email protected] Subject: [cfaussie] Re: How do myQuery["columnName"] ? Well I don't see what's wrong with (2) that's the best way but you could <cfset column = "myColumn"/> <cfloop query="myQuery"> evaluate("myQuery.#column#") </loop> Regards Dale Fraser -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Mandel Sent: Monday, 22 May 2006 12:13 PM To: [email protected] Subject: [cfaussie] How do myQuery["columnName"] ? Hey all, This seems like a stupid question, but I can't seem to figure it If I have a query, called 'myQuery' I can do: (1) <cfloop query="myQuery"> myQuery.column </loop> and it will output fine. I can do: (2) <cfset column = "myColumn"/> <cfloop query="myQuery"> myQuery[column][myQuery.currentRow] </loop> and it will output fine But if I do: (3) <cfset column = "myColumn"/> <cfloop query="myQuery"> myQuery[column] </loop> I get the error: Complex object types cannot be converted to simple values. Is option (2) the only way to handle dynamic column names? I had thought option 3 would work.. but it doesn't seem to... Help? Mark -- E: [EMAIL PROTECTED] W: www.compoundtheory.com ICQ: 3094740 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~---
