returning an array from a query

2010-11-14 Thread mojtaba tabatabaie
hi . I have written a cfc which has a function which has a query and I want the result of that query to be returned as an array and I have specified the return type of the function to Array . I hope I can then use that Array in my Flex application . but I can't return the right value and CF

returning an array from a query

2010-11-14 Thread mojtaba tabatabaie
hi . I have written a cfc which has a function which has a query and I want the result of that query to be returned as an array and I have specified the return type of the function to Array . I hope I can then use that Array in my Flex application . but I can't return the right value and CF

Re: returning an array from a query

2010-11-14 Thread Matt Quackenbush
You need to loop over the query result and build the array to return. Something like so... ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive:

RE: returning an array from a query

2010-11-14 Thread Russ Michaels
I don't know if you realise, but you can actually treat a query an an associative array anyway, you do not need to do any conversion to do this. The syntax is Query['column'][row] Might save you some work -- Russ Michaels http://www.bluethunderinternet.com : B2B hosting, VPS's, Exchange, CF,

Re: returning an array from a query

2010-11-14 Thread Matt Quackenbush
I don't use Flex, but wouldn't that still appear to Flex as an invalid data type (e.g. not an array)? But yes, in CF, most certainly use that syntax. :-) ~| Order the Adobe Coldfusion Anthology now!

Re: returning an array from a query [spamtrap bayes][spamtrap heur]

2010-11-14 Thread Paul Hastings
On 11/15/2010 2:10 AM, mojtaba tabatabaie wrote: cfset setEncoding(form,utf-8) cfset setEncoding(url,utf-8) these aren't required in your CFC. just return the query to flex use something like this in your event handler: private function