User Guide

Table Of Contents
484 Chapter 21: Updating Your Database
<cfset form.contract = "No">
<cfelse>
<cfset form.contract = "Yes">
</cfif>
<cfupdate datasource="cfdocexamples"
tablename="Employee">
<h1>Employee Updated</h1>
<cfoutput>
You have updated the information for #Form.FirstName#
#Form.LastName# in the employee database.
</cfoutput>
</body>
</html>
2.
Save the page as update_action.cfm.
3.
View update_form.cfm in your web browser by specifying the page URL and an Employee ID;
for example, enter the following:
http://localhost/myapps/update_form.cfm?Emp_ID=3
The current information for that record appears:
4.
Enter new values in any of the fields, and click Update Information.
ColdFusion updates the record in the Employee table with your new values and displays a
confirmation message.