expected. I think you will need a where clause for sizes too.
Qasim
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 2:54 PM
To: CF-Talk
Subject: looping over form values
On my form I have:
Size:<input type="text" name="size" size="10">Sku: <input type="text"
name="SKU" size="10">
Size:<input type="text" name="size" size="10">Sku: <input type="text"
name="SKU" size="10">
Size:<input type="text" name="size" size="10">Sku: <input type="text"
name="SKU" size="10">
Upon submitting I have:
<cfloop index="i" list="#form.size#" delimiters=",">
<cfquery name="insertproductsizes" datasource="" username=""
password="">
insert into productsizes
(productid, size)
values
('#variables.newid#', '#i#')
</cfquery>
</cfloop>
<cfloop index="j" list="#form.sku#" delimiters=",">
<cfquery name="updatesizes" datasource="" username="" password="">
update productsizes
set
sku = #j#
where productid = #variables.newid#
</cfquery>
</cfloop>
The first loop inserts fine, the second loop only inserts the last
form.sku (if form.sku equals 1,2,3...3 gets updated in every instance of
the where statement).
What am I doing wrong?
Thanks!
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

