I’ building a CF structure using the flash.params[] array as the keys. The problem is all the structe keys are named “Flash” as if i’m passing it a string. I’ve used the ## around it. I’ve tried array and object notation and noting is working. below is the code
<cfset num_items = ArrayLen(Flash.Params[1])>
<cfset session.grand_total = 0.00>
<cfset mystruct = StructNew()>
<!---The array (value) of each key is [1]=Name,[2]=Price,[3]=Quantity --->
<!--- I want to get the info from the db and add it to my structure --->
<cfloop from="1" to=#num_items# index="counter">
<!--- First lets see if the key is already in the structure --->
<cfif StructKeyExists(mystruct,Flash.Params[1][counter]) EQ TRUE>
<!---If it does exist, just increase its quantity in the array--->
<cfset mystruct.Flash.Params[1][counter][3] = #mystruct.Flash.Params[1][counter][3]# + 1>
<cfelse>
<!---If it doesnt, then 1)query the inventory id, save its info to an array and save the array and a value to the structre--->
<cfquery name="get_item_info" datasource="flipflop">
SELECT * FROM Tiles WHERE id = '#Flash.Params[1][counter]#'
</cfquery>
<!--- Now that I have the info based on the product number, I need to make an array to place the info into --->
<cfset myarray = ArrayNew(1)>
<cfset myarray[1] = #get_item_info.name#>
<cfset myarray[2] = #get_item_info.price#>
<cfset myarray[3] = 1>
<!---Now I need to make an insertion into the structure --->
<cfset mystruct.Flash.Params[1][counter] = myarray>
<!---The item has now been added to the structure --->
</cfif>
</cfloop>