I am a bit stuck and need some help inserting multiple records in to a db table.
I have a form that is going to insert several products at once in to a cart table. The customer types in the quantity of each product they want, then they hit the submit button to insert those products in to the cart table. I am not sure how to loop through and insert all the products at once and as seperate records!?
The form looks like this:
<cfoutput query="productDetails">
<form action="cart.cfm?action=insert" method="post">
<input type="text" value="0" name="QTY" maxlength="5" size="2>
<input type="hidden" name="prodID" value="#prodID#" / >
<input type="hidden" name="price" value="#price#" / >
<input type="hidden" name="stamp" value="#stamp#" / >
</cfoutput>
<input type="submit" name="submit"></form>
How do I loop through and insert all of the records at once?Also, if the value of "QTY" is "0", how do I prevent that record from being inserted?
Thank you!!
I have a form that is going to insert several products at once in to a cart table. The customer types in the quantity of each product they want, then they hit the submit button to insert those products in to the cart table. I am not sure how to loop through and insert all the products at once and as seperate records!?
The form looks like this:
<cfoutput query="productDetails">
<form action="cart.cfm?action=insert" method="post">
<input type="text" value="0" name="QTY" maxlength="5" size="2>
<input type="hidden" name="prodID" value="#prodID#" / >
<input type="hidden" name="price" value="#price#" / >
<input type="hidden" name="stamp" value="#stamp#" / >
</cfoutput>
<input type="submit" name="submit"></form>
How do I loop through and insert all of the records at once?Also, if the value of "QTY" is "0", how do I prevent that record from being inserted?
Thank you!!