creating variables from a query problem

2009-05-28 Thread alex poyaoan
HI everybody,, Am stucked... I have a query with 9 rows. I need to store every row into a different distinct variable. my query is listed below cfquery name=getcs datasource=#datasource# SELECT COUNT(s.id) AS cscount FROMSociety s WHERE s.gr='cs' group by s.asst /cfquery cfoutput

Re: creating variables from a query problem

2009-05-28 Thread Peter Boughton
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

Re: creating variables from a query problem

2009-05-28 Thread alex poyaoan
Thanks will do that then 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

Re: creating variables from a query problem

2009-05-28 Thread Scott Stroz
Just to throw out another solution, you can get the same result you initailly tried by doing the following: cfloop query=getcs cfset variables[rowgetcs.currentRow] = getcs.cscount / /cfloop On Thu, May 28, 2009 at 7:58 AM, Peter Boughton bought...@gmail.com wrote: I need to store every

Re: creating variables from a query problem

2009-05-28 Thread James Holmes
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