Question
Inserting multiple lists
I have a form with checkboxes, all the same name. The output
is a list separated by commas. So when I insert into my table, I do
soemthing like this :
<cfloop list="#form.error_id#" index="error_id_value">
<cfquery name="qryInsert_Error_Log" datasource="dbName">
Insert into UnReceivables_Error_Log
(error_transaction_id,
error_id,
ref_number,
error_status)
values
('#error_txn_id#',
'#error_id_value#',
'#ref_number#',
'active')
</cfquery>
Now I have a form that uses javascript to add additional rows to the form. Each row contains a part number, qty, and cost. If I genearate and add five rows, and when I submit, I use cfoutput to display the values and they come out as pn1,pn2,pn3,pn4,pn5 and qty1,qty2,qty3,qty4,qty5 and cost1,cost2,cost3,cost4,cost5.
What do I have to do to insert each list/value record into a table, so that they all correspond to one anohter ?
For example, the first row in the table, after insert, should be pn1, qty1, and cost 1. The second row should be pn2, qty2, and cost2, etc.
Thanks for any help.
<cfloop list="#form.error_id#" index="error_id_value">
<cfquery name="qryInsert_Error_Log" datasource="dbName">
Insert into UnReceivables_Error_Log
(error_transaction_id,
error_id,
ref_number,
error_status)
values
('#error_txn_id#',
'#error_id_value#',
'#ref_number#',
'active')
</cfquery>
Now I have a form that uses javascript to add additional rows to the form. Each row contains a part number, qty, and cost. If I genearate and add five rows, and when I submit, I use cfoutput to display the values and they come out as pn1,pn2,pn3,pn4,pn5 and qty1,qty2,qty3,qty4,qty5 and cost1,cost2,cost3,cost4,cost5.
What do I have to do to insert each list/value record into a table, so that they all correspond to one anohter ?
For example, the first row in the table, after insert, should be pn1, qty1, and cost 1. The second row should be pn2, qty2, and cost2, etc.
Thanks for any help.
