Hello all,
I first want to say that this site and it's patrons have been incredibly helpful and an invaluable resource, thanks tek-tips
I have a for loop which inserts data fine, the problem is that the variables in the loop can contain more than one item (i.e. multiple items in one order).
Currently it will insert the data it collects on it's last run through...
here is the code
I have tried to illustrate how I think it should work with the comments, essentially the outcome I am looking for is... if a user orders more than one item, I would like to insert an individual line in the table for each item while they can share the same orderID.
I am relatively new to ASP so any help is much appreciated.
I first want to say that this site and it's patrons have been incredibly helpful and an invaluable resource, thanks tek-tips
I have a for loop which inserts data fine, the problem is that the variables in the loop can contain more than one item (i.e. multiple items in one order).
Currently it will insert the data it collects on it's last run through...
here is the code
Code:
for each item in Request.form("strOrderItem")
strOrderItem = cstr(item)
itemInfo = split(strOrderItem, ",")
rsItem.addNew
rsItem("orderID") = intOrderID 'same orderID
rsItem("productID") = itemInfo(0) 'one or more
rsItem("itemPrice") = itemInfo(1) 'one or more
rsItem("beforeTax") = itemInfo(2) 'one or more
rsItem("sAmt") = itemInfo(3) 'one or more
rsItem("PST") = itemInfo(4) 'one or more
rsItem("GST") = itemInfo(5) 'one or more
rsItem("quantity") = itemInfo(6) 'one or more
rsItem.Update
next
I have tried to illustrate how I think it should work with the comments, essentially the outcome I am looking for is... if a user orders more than one item, I would like to insert an individual line in the table for each item while they can share the same orderID.
I am relatively new to ASP so any help is much appreciated.