Attempting query update from array
I'm attempting to update a table from an array by looping it over but having no luck. There doesn't seem to be much info out there on how to do this, everything I've found is related to looping queries into arrays (the reverse obviously). It's seems like it should be simple enough the test array is;
(sel, optiontype_ID)
[1] [1] Blue
[1] [2] 65
[2] [1] White
[2] [2] 73
And my attempt.....
<cfloop index="x" from="1" to="#arrayLen(arr1[sel])#">
<cfloop index="y" from="1" to="#arrayLen(arr1[optiontype_ID])#">
<cfquery datasource="#request.dsn#" username="#request.dsnUsername#" password="#request.dsnPassword#">
update tbl_skuoptions
set option_name = '#arr1[sel]#'
where option_Type_ID = '#arr1[optiontype_ID]#'
</cfquery>
</cfloop>
</cfloop>
Any ideas or even a slap upside the head from Dan would be appreciated.
Thanks!
David
