Hello,
I'm trying to insert multiple value list passed through a
form, but I can only accquired only one list. what I mean is I'm
trying to pass two list on two different values as follow:
ipa_code_ = "228,420,457"
payor_code_ = "WC,HU,DMG,PC,VA"
and below is the code that I'm trying to use to accomplish
this:
<cfif (username) NEQ "" AND (ipa_id_) NEQ "">
<!---This loops through the ipa codes and inserts a
record for each line--->
<cfloop index="curLine" list="#ipa_id_#">
<cfquery datasource="#request.dsn#">
INSERT INTO Assign_ipa
(ipa_id,hmoid,userid,username,PayorCode)
VALUES
('#curLine#','#hmoid#','#userid#','#username#','#PayorCode#')
</cfquery>
</cfloop>
<!---This tries to update the previously inserted values
from above but it does not work, is trying to update the records
with the payor codes---->
<cfloop index="curLine" list="#PayorCode_#">
<cfquery datasource="#request.dsn#">
UPDATE Assign_ipa SET PayorCode = '#curLine#'
WHERE userid = '#userid#'
</cfquery>
</cfloop>
<cfset msg = "You successfully assigned IPAs to
("&#username#&")!">
<cfelse>
<cfset msg = "You NOT assigned IPAs to the users!">
</cfif>
So as you can see from the code above it will not work
because every time I try to update the records only one value from
the list is taken and updated.
ipa_code hmoID userid username payor_code
228 1 41 reya10276 VA
420 1 41 reya10276 VA
457 1 41 reya10276 VA
Any ideas on how to accomplish this would be greatly
appreciated, thanks.