If commentId is already a unique ID then try making your form fields like
this:
<input name="commentActive_<cfoutput>#commentId#</cfoutput>"...
You don't even need a hidden commentId field.
Then in your handler:
<cfloop collection="#form#" item="field">
<cfif listFirst(field, "_") eq "commentActive">
<cfset commentId = listLast(field, "_")>
<cfset commentActive = form[field]>
<cfquery ...>
update commentsorwhateverthetableiscalled
set commentactive = <cfqueryparam value="#commentactive#"
cfsqltype="CF_SQL_VARCHAR">
where commentid = #commentId#
</cfquery>
</cfif>
</cfloop>
Matthew Walker
Electric Sheep Web
http://www.electricsheep.co.nz/
----- Original Message -----
From: "Russ" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, February 23, 2003 11:37 AM
Subject: RE: Updating Multiple Records
> When I do a cfdump, I get:
>
> 8 testing testing *boom!* 1
> 9 Excellent! Made #3 Active 1
> 11 humdedum 1
>
> I shouldn't have been using commentID#i# anyway, as that's already a
> unique identifier. Fixing that doesn't resolve the issue and I'm still
> seeing this error:
>
> Syntax error in UPDATE statement.
>
> The error occurred in
> C:\Inetpub\wwwroot\blinktag\mod\comments\commentUpdate.cfm: line 15
>
> 13 :
> commentActive=#Evaluate("FORM.commentActive#i#")#
> 14 : WHERE commentID=#FORM.commentID#
> 15 : </cfquery>
> 16 : </cfloop>
> 17 :
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4