You'll have to loop over single inserts (one row at a time):

<cfloop from="1" to="#ArrayLen(Session.Cart.productID)#"
index="i">
  <cfquery ...>
INSERT INTO yourTable (col1, col2, col3)
VALUES (
  <cfqueryparam value="#session.var1[i]#" cfsqltype="CF_SQL_VARCHAR">,
  <cfqueryparam value="#session.var2[i]#" cfsqltype="CF_SQL_VARCHAR">,
  <cfqueryparam value="#session.var3[i]#" cfsqltype="CF_SQL_VARCHAR">
)
  </cfquery>
</cfloop>

On Wed, 25 Feb 2004 11:26:51 -0500, in cf-talk you wrote:

>Hello,
>
>First I would like to add to a comment that was made today
>and show my appreciation for the help that you all give so
>freely.  I am new to coldfusion and just reading these e-
>mails have made me a diehard coldfusion fan. Thanks!  now on
>to my question!!
>
>I am new to structures and arrays, and I need to insert the
>results of a cfloop on the array into my database. Can you
>insert a cfloop?  Sample array output in below I have
>removed the table formating code:
>
><cfloop from="1" to="#ArrayLen(Session.Cart.productID)#"
>index="ThisItem">
>        <cfoutput>
>        <cfoutput>#Session.Cart.productID[ThisItem]
>#</cfoutput>
>        <cfoutput>#Session.Cart.productTitle[ThisItem]
>#</cfoutput>
>        <cfoutput>#Session.Cart.Qty[ThisItem]#</cfoutput>
>        <cfoutput>#Dollarformat(Session.itemTotal)
>#</cfoutput>
>        </cfoutput>
></cfloop>
>
>Thanks for the assistance!
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to