Hi all,

I'm looking for a way to update multiple lines in a database using a form.
While I've had no trouble updating single records, this whole multiple thing
throws me for a major loop. The query is based on a yes/no field in the
database (pulling all records that = yes), and the changes I am trying to make
are using a cfinput checkbox, so I'm not sure on how to specify the records
that need to be adjusted. Essentially I'd like to be able to remove entries
from the query by unchecking the checkbox and clicking a form submit, and to
have this work when I uncheck multiple records at once.

Ideally I'd like the submit to return to the same page (as it is right now ),
which also raises the question of how to have the logic pick up the values
submitted by the form so that it doesn't update everytime the page loads.
Thanks a pile for the help - I'm such a newbie:)

<cfparam name="issueYES" default="YES">

<!--- will update thisWeek field when form is submitted --->
<cfif some sort of condition is true>
<cfquery datasource="wrf">
UPDATE commentArticles
SET thisWeek = #FORM.thisWeek#
</cfquery>
</cfif>

<!--- queries thisWeek for page output --->
<cfquery name="currentIssue" datasource="wrf">
SELECT * FROM commentArticles INNER JOIN authors ON authors.authorID =
commentArticles.authorID
WHERE thisWeek = #issueYES#
ORDER BY articleID DESC
</cfquery>

<!---Output begins --->
<cfform action="comment.cfm">

<table width="100%" border="0" cellspacing="0" cellpadding="5">
<cfoutput query="currentIssue">
<cfif currentIssue.currentrow mod 2 eq 1><tr
bgcolor="##D6D6D6"><cfelse> <tr></cfif>
<td width="5%"><cfinput
type="checkbox" name="thisWeek" value="checkbox" checked="#thisWeek#"></td>
<td width="75%"><span class="style9"><a
href="##"><strong>#currentIssue.ArticleTitle#
#currentIssue.ArticleSubtitle#</strong></a>
<br>
<span
class="style10">posted by </span></span><span class="style10">#firstName#
#lastName#</span><span class="style9"></span></td>
<td width="20%" align="left"
valign="top"><span class="style9"><a
href="dingo.cfm?ID=#URLEncodedFormat(articleID)#"> <img src="../images/edit.gif"
width="14" height="16" border="0" class="floatLeft">Edit</a><br>
<br>
<a
href="dingo.cfm?ID=#URLEncodedFormat(articleID)#"> <img
src="../images/delete.gif" width="16" height="16" border="0"
class="floatLeft">Delete</a></span><br>
</td>
</tr>
</cfoutput>
</table>
<br>
<cfinput type="submit" name="Submit" value="Update'This Week'">