MACROMEDIA COLFUSION MX 7-CFML Reference page 443

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

Attribute
Req/Opt
password
Optional
formFields
Optional
Example
<!--- This example allows you to update a person's telephone number in the
employee table. --->
<cfif isDefined("form.phone")>
<cfupdate datasource="cfdocexamples" tablename="Employees">
</cfif>
<cfquery name="empTable" datasource="cfdocexamples">
select * from employees
</cfquery>
<!--- This code shows the contents of the employee table and allows you to
choose a row for updating. --->
<table border="1">
<cfoutput query="empTable">
<tr>
<td>#firstName#</td>
<td>#lastName#</td>
<td>#phone#</td>
<td><a href="cfupdate.cfm?id=#emp_id#">Edit</a></td>
</tr>
</cfoutput>
</table>
<cfif isDefined("url.id")>
<cfquery name="phoneQuery" datasource="cfdocexamples">
select * from employees where emp_id=#url.id#
</cfquery>
<!--- This code displays the row to edit for update. --->
<cfoutput query="phoneQuery">
<form action="cfupdate.cfm" method="post">
#phoneQuery.firstName# #phoneQuery.lastName#
<input name="phone" type="text" value="#phone#" size="12">
<input type="submit" value="Update">
<input name="emp_id" type="hidden" value="#emp_id#">
<!--- The emp_id is passed as a hidden field to be used as a primary key in
the CFUPDATE. --->
</form>
</cfoutput>
</cfif>
Default
Description
Overrides the
(all on
Comma-delimited list of form fields to update.
form,
If a form field is not matched by a column name in the
except
database, ColdFusion throws an error.
keys)
The formFields lies must include the database table
primary key field, which must be present in the form. It can
be hidden.
value specified in ODBC setup.
password
cfupdate
443

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents