Cycle through list and build compound array...
I have a database that I'm pulling data from that is already existing. There is a designs table and a details table. The designs table stores the id's of the details items that are associated with the design. Since I'm using Flash remoting I would like to just get all the designs and their details back in one compound array instead of making a bunch of calls. I'm stuck on how to make the string "5,8,12,19" into an array, cycle through the array and then get the details info for each id. Then return the compound array when finished.
I would prefer the array be like this:
[design item 1 and it's data][details array of the design 1 items], [design item 2 and it's data][details array of the design 2 items]....
Here is what I have so far
<cffunction name="getDesignsByAct" access="remote" returntype="query" hint="gets activities by id">
<cfargument name="send_id" type="numeric" required="yes" />
<cfquery name="getDesignsByActQuery" datasource="#dsn#">
SELECT design_id, design_items
FROM designs_table
WHERE design_activity = #send_id#
</cfquery>
<cfquery name="getDetailsQuery" datasource="#dsn#">
SELECT
*
FROM
details_table
WHERE <!-- cycle through the list of "design_items" in the above query -->
</cfquery>
<cfset this_return[1] = getDesignsByActQuery>
<cfset this_return[2] = getDetailsQuery>
<cfreturn this_return >
</cffunction>
Thanks in advance.
