|
|
Question : nested query loop problem
|
|
I am trying to build a dynamic page that loops through all the fields and records of a particular table. This is the section of relevant code:
#evaluate('qryData.' & qryField.Name)# |
qryField's records ('Name' field) are the field names in qryData.
What I want is a table like record1-field1, record1-field2 record2-field1, record2-field2
unfortunately this code gives me
record1-field1, record1-field2 record1-field1, record1-field2
- same record repeated over and over
when I put qryData.currentRow I get 1,2,3 ... etc so the outer loop is working but not outputting properly in the inner loop - any idea why?
Thanks
Shane
|
Answer : nested query loop problem
|
|
This is a sample, obviously you need to replace q.test with your query name and column name and you need to leave out everything between the cfscript
q = queryNew("test"); i = 1; while ( i LTE 19 ) { queryAddRow(q); querySetCell(q, "test", i); i = i + 1; }
#q.test[ variables.i ]# | #q.test[ variables.myI ]# |
|
|
|
|
|