Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating more than one record at once

Status
Not open for further replies.

junkjones

Programmer
Jul 14, 2000
52
GB
I want to be able to update multiple records, based on the user changing one record. I have a table called 'comps', and each record in this table has a field called 'groupname' to associate it with a group of graphics). The value of 'approved' is 'null' by default for each new record. I want a user to be able to come in and change one record so that the value of 'approved' becomes 'yes'. My problem is getting all the other records with the same 'groupname' to automatically change their value of 'approved' to 'no'. Am I making sense? [sig][/sig]
 
Hi,

In sql it would be something like this:

<cfquery name=&quot;update&quot; datasource=&quot;cccc&quot;>
update comps set approved = 'yes' where
groupname=&quot;#groupname#&quot;>

Toon [sig][/sig]
 
Thank you ToonKayser! I am new to ColdFusion so I had no idea you could do this!! :) I changed the code to:

<cfquery name=&quot;update&quot; datasource=&quot;cccc&quot;>
update comps set approved = 'no'
where groupname='#groupname#'
</cfquery>

and it worked perfectly!! You're a life saver :) [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top