Coast Line
asked on
Appending query Data into array of Structure for a structure
I have a structure and that structure already has a data like this
http://prntscr.com/d49e6w
and now i have a query which i want to convert that query to append to this line_items structure
i have the following query:
but this query is only appending the last record
any idea how can i fix it
so all i need is to append the bottom one to the upper one added
http://prntscr.com/d49e6w
and now i have a query which i want to convert that query to append to this line_items structure
i have the following query:
<cfset st.line_items = []>
<cfloop from="1" to="#arrayLen(quest)#" index="i">
<cfset st.line_items[i] = {}>
<cfset st.line_items[i].item_id = itemid>
<cfset st.line_items[i].name = name>
<cfset st.line_items[i].rate = rate>
<cfset st.line_items[1].description = "">
<cfset st.line_items[i].quantity = quantity>
</cfloop>
<cfloop query="oldItems">
<cfset st.line_items[i].item_id = oldItems.item_id>
<cfset st.line_items[i].name = oldItems.item_name>
<cfset st.line_items[i].rate = oldItems.item_rate>
<cfset st.line_items[i].description = oldItems.item_description>
<cfset st.line_items[i].quantity = oldItems.item_quantity>
</cfloop>
but this query is only appending the last record
any idea how can i fix it
so all i need is to append the bottom one to the upper one added
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Comes in handy when position isn't important, you just want to add something to the end of the array :)
ASKER