John,
One, your query is not set up correctly.
You need to have it like this.
This is an example of the update statement in SQL. Not your query.
<cfquery name="update" datasource="myDSN">
update TableName
Set ColumnName1 = Value1,
ColumnName2 = Value2
Where myId = passedID
</cfquery>
Two, the form you have just before you do the update is set up that each
row on that form is supposed to be one record in the database.
So, you need to dynamically name your fields in the form to be able to
group the rows together.
Like so.
<cfoutput query="getQuery">
<input type="text" name="FirstName#CurrentRow#"
value="#getQuery.FirstName#">
<input type="text" name="myId#CurrentRow#"
value="#getQuery.id#">
</cfoutput>
You will need to know how many records you will be updating. So make a
hidden field to pass the recordcount, this is the easiest way. This
does not go inside the query loop.
<input type="hidden" name="myLoopCount" value="#getQuery.recordcount#">
On the processing page it will something like this.
<cfloop from="1" to="#Form.myLoopCount#" index="i">
<cfquery name="doUpdate" datasource="myDSN">
update TableName
set FirstName = '#Evaluate("Form.FirstName" & i)#'
where id = #Evaluate("myId" & i)#
</cfquery>
</cfloop>
This should get you headed in the right direction.
Chuck Weidler
Lockheed Martin Information Technology
3108 Lord Baltimore Drive
Baltimore, MD 21244
Voice: (443) 348-2169
Fax: (443) 348-2233
Email: [EMAIL PROTECTED]
-----Original Message-----
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 08, 2007 9:18 AM
To: CF-Newbie
Subject: Re: Extreme Help
That's your update query, however where's the query that shows the
information? On the previous page?
http://inside.3i-online.com/reps_test/GetReps_Query_Next.cfm?CFID=198350
2&CFTOKEN=22280223
Are you using <cflocation> ?
On 2/8/07, John Eubanks <[EMAIL PROTECTED]> wrote:
> >so whats the query that you have thats generating that page?
> >
> >On 2/7/07, John Eubanks <[EMAIL PROTECTED]> wrote:
> >>
> Greg,
>
> Here is the query:
>
> <cfquery name="Update" datasource="3iReps"> Update
>
RepFinder_Basic.FirstName,RepFinder_Basic.LastName,RepFinder_Basic.Regio
n,RepFinder_Basic.Region,RepFinder_Basic.RepId,RepFinder_Ext.FirstName,R
epFinder_Ext.LastName,RepFinder_Ext.Region,RepFinder_Ext.RepId,RepFinder
_Ext.Phone,RepFinder_Ext.Ext,RepFinder_Ext.BegZip,RepFinder_Ext.EndZip
> Set RepFinder_Basic.FirstName =
'#Form.RepFirstName#',RepFinder_Basic.LastName =
'#Form.RepLastName#',RepFinder_Basic.Region =
'#Form.RepRegion#',RepFinder_Basic.RepId =
'#Form.RepId#',RepFinder_Ext.FirstName =
'#Form.RepFirstName#',RepFinder_Ext.LastName =
'#Form.RepLastName#',RepFinder_Ext.Region =
'#Form.RepRegion#',RepFinder_Ext.RepId =
'#Form.RepId#',RepFinder_Ext.Phone = '#Form.Phone#',RepFinder_Ext =
'#Form.Ext#',RepFinder_BegZip = '#Form.BegZip#',EndZip = '#Form.EndZip#'
> WHERE RepFinder_Basic.RepId IN (#Form.RepId#)
> </cfquery>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2497
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15