-----Original Message-----
From: Scott Brady [mailto:[EMAIL PROTECTED]
Sent: Friday, July 02, 2004 1:31 PM
To: CF-Talk
Subject: re: multiple column update
Original Message:
> From: Greg Morphis
Which version of ColdFusion are you using? My suggestions below assume MX. First, for your form, I'd use a hidden form field that gives a list of every qid. So, on your form page, I'd have:
<!--- Assumes your form gets its data from a query called "myQuery" --->
<input type="hidden" name="qid" value="#VALUELIST(myQuery.qid)#" />
Now, on the processing page:
<!--- Loop along that hidden field --->
<cfloop list="#FORM.qid#" index="i">
<!--- For each quota_id, update the table --->
<cfquery name="updQuotas" datasource="#dbDatabaseName#">
UPDATE maintain_quotas
SET
monthly_total_quota = <cfqueryparam value="#FORM['quotat_' & i]#" cfsqltype="cf_sql_numeric">,
monthly_dsl_quota = <cfqueryparam value="#FORM['quotad_' & i]#" cfsqltype="cf_sql_numeric">
WHERE
quota_id = <cfqueryparam value="#i#" cfsqltype="cf_sql_numeric">
</cfloop>
Let me know if any of that's not clear.
Scott
---------------------------
Scott Brady
http://www.scottbrady.net/
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

