>If you're not a praying man, don't send the ArrayCollection.
>ArrayCollection is really just a wrapper for an array that adds some
>extra functionality like getItemAt().  Pass in the underlying array,
>which would be optionsAC.source.
>
>then you'll be able to type your cfargument to an array.
>
>On Wed, May 14, 2008 at 2:59 PM, Jennifer Larkin <[EMAIL PROTECTED]> wrote:
>>

Thanks for the quick reply, guys. 

Charlie: You're right, I'm not a praying man AND your advice worked! :)

Thanks so much.

I've included the amended code in case anyone is interested.

Code:

<cffunction name="saveQuiz" access="remote" returntype="boolean" hint="Saves 
new quiz to quiz_questions.">
    <cfargument name="quizQuestion" type="string" required="yes">
    <cfargument name="quizAnswer" type="string" required="yes">
    <cfargument name="optionsAC" type="array" required="yes">
    <cfset var qRead="">
    <cfquery name="savedQuizQuestion" datasource="my_db" result="savedQuizID">
INSERT into quiz_questions (quizQuestion, quizAnswer)
VALUES ('#ARGUMENTS.quizQuestion#', '#ARGUMENTS.quizAnswer#')
        </cfquery>
    <cfloop from="1" to="#ArrayLen(optionsAC)#" index="i"> 
    <cfquery name="savedQuizOptions" datasource="my_db">
INSERT into quiz_options (quizID, optionName, correct)
VALUES ('#savedQuizID.GENERATED_KEY#', '#optionsAC[i].label#', 
'#optionsAC[i].data#')
</cfquery>
</cfloop>
    <cfreturn true>
    </cffunction> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:5252
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to