Hello, Im not really familiar with arrays and loops and Im
getting stuck.
I pass some javascript vars to a CFM page via URL.
Example Link.
http://localhost/drag/page2.cfm?Groups=group_1,16,20,group_2,2,13,17,group_3,3,11,group_4,9,12,group...
I managed to put it into an array and here are my results.
array
1 group_1
2 16
3 20
4 group_2
5 2
6 13
7 17
8 group_3
9 3
10 11
11 group_4
12 9
13 12
14 group_5
15 14
16 4
17 group_6
18 5
19 10
20 group_7
21 6
22 15
23 group_8
24 1
25 7
26 group_9
27 8
28 19
29 18
------------------------------------------------------------------------------------
I was wanting to have the array show the data in this fasion
so i can insert into db
group_1,16
group_1, 20
group_2, 2
group_2, 13
group_2,17
Here is my code... I would really appreciate any help.
<cfset MyArray = ArrayNew(1)>
<cfset mylist="#URL.Groups#">
<cfloop from="1" to=#ListLen(mylist)# index="i">
<cfset MyArray
= ListGetAt(mylist, i)>
<cfoutput>#MyArray#<br></cfoutput>
</cfloop>