> I have a form that contains an outcome field, which has an "_#ac_id"
> appended to it so I can properly identify it (their can be many fields
> passed in). I seem to be at a loss for how to output what appears to be two
> variables as one ('#outcome_#ac_id##' -- see below query). Is their a way to
> properly concatenate these or another recommended method?
>
> -- Referenced Query
> UPDATE nonprofitContacts
> SET outcome = '#outcome_#ac_id##'
> WHERE nonprofitContacts_id = '#ac_id#'
If I understand you correctly, you have form fields named "outcome_1",
"outcome_2" or something like that, right?
<cfloop from="1" to="#max_ac_id#" index="i"> <!-- you might need to
track the highest ac_id -->
<cfquery ...>
UPDATE ...
SET outcome = <cfqueryparam cfsqltype="cf_sql_varchar"
value="#Form["outcome_" & i]#">
WHERE nonprofitContacts_id = <cfqueryparam
cfsqltype="cf_sql_integer" value="#i#">
</cfquery>
</cfloop>
Note the use of CFQUERYPARAM there too - it doesn't have anything to
do with your posted question, but you should always use it when you
use values from the browser in your SQL statements.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or o
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338494
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm