If I understand correctly, you're looking to loop over two lists at the same
time.
If the lists are productIDs and quantities then try the following:
<cfloop from="1" to"#ListLen(productIDs)#" index="i">
<cfoutput>
<p>
Product ID: #ListGetAt(productIDs, i)#<br />
Quantity: #ListGetAt(quantities, i)#
</p>
</cfoutput>
</cfloop>
Swap in your SQL code and away you go.
Ade
-----Original Message-----
From: Tim Laureska [mailto:[EMAIL PROTECTED]
Sent: 01 October 2005 22:43
To: CF-Talk
Subject: a little loop help plz
I've got a form that passes two variable lists:
1) Product id (could be up to 3 different product id's)
2) Quantity of product corresponding to the product name:
I'm trying to insert the product ids and the product quantities into the
same table. I can break down and insert one variable list (ex. product
id) into a linking table by using something like:
<cfset product_List="#form.product_id#">
<cfloop index="i" list=#product_list# delimiters=",">
<cfquery datasource="#datasource#">
INSERT INTO products (product_id)
VALUES #i#
</cfquery>
</cfloop>
But If I want to "breakdown" the quantity list for that product_id and
insert it into the same linking table I get stuck
Can someone lend a hand here with a pointer
Thanks
Tim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219834
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54