And finally, you could simpy reference the original query using array
notation (e.g. getcs["cscount"][1], getcs["cscount"][2] etc) and avoid
the extra work.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/5/28 Scott Stroz <boyz...@gmail.com>:
>
> Just to throw out another solution, you can get the same result you
> initailly tried by doing the following:
>
> <cfloop query="getcs">
>     <cfset variables["row"&getcs.currentRow] = getcs.cscount />
> </cfloop>
>
> On Thu, May 28, 2009 at 7:58 AM, Peter Boughton <bought...@gmail.com> wrote:
>>
>>> I need to store every row
>>> into a different distinct variable.
>>
>> You probably don't, and should instead be using an array.
>>
>>
>> MyValues = ListToArray( ValueList( MyQuery.ColumnName ) )
>>
>> Then you can do MyValues[1] to MyValues[9] to get at the variables.
>>
>>
>> If you *really* need to create individual variables, you can then do:
>>
>> <cfloop index="i" from="1" to="#ArrayLen(MyValues)#">
>>    <cfset Variables['MyVariable#i#'] = MyValues[i] />
>> </cfloop>
>>
>> But don't do that - use the array.
>>
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322865
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to