Struggling with array notation when converting to cfqueryparam
I'm checking through some old code, tidying it up a little and making sure everything is using cfqueryparam - I've got the following bit of code and not sure what to do with it - I know cf_sql_array is available but I can't find any examples of information on it (or if that's exactly what I should be looking at):
| <cffunction name="myfunction" access="public" returntype="void" output="false"> |
<cfloop index="i" list="#visualList#">
<cfif form["visual" & i] neq "NA">
<cfquery name="assetVisualCheck" datasource="#APPLICATION.Config.dbdsnd#" username="#APPLICATION.Config.dbuname#" password="#APPLICATION.Config.dbpass#">
INSERT INTO assetVisual
(visualAssetID, visualBy, visualDate, visualResult)
Values ('#i#', '#cgi.REMOTE_USER#', now(), '#form["visual" & i]#')
</cfquery>
</cfif>
| </cfloop> | |
| </cffunction> |
list="#visualList#" should be a straightforward swap, #i# and #cgi.remote_user# don't need binding
'#form["visual" & i]#' is the bit I want to make sure is right. #form.visual1# is a "P", "F" or "X"
Am I overthinking this and it should just be
| <cfqueryparam cfsqltype="cf_sql_char" maxlength="1" | value="#ARGUMENTS["visual" & i]#" |
