User Guide
Enhancing the Trip Maintenance application 83
The following page shows the expected result:
Reviewing the code
The following table describes the ColdFusion code used to build the Trip Detail page:
Code Explanation
<cfquery name="TripQuery"
dataSource="CompassTravel"
maxRows=1>
The cfquery tag includes a maxRows attribute. This attribute
limits the number of result rows brought back from the
database. In the Trip Detail page, we want to only show a
single row at a time, therefore,
maxRows is set to 1.
<cfif IsDefined("URL.ID")>
WHERE tripID = #URL.ID#
</cfif>
The URL.ID specifies a parameter that can be contained
within the URL that requests this page. If the ID parameter
is passed within the URL, it is used in the SQL query to
identify the tripID to SELECT. You can use the CFML
function
IsDefined to determine if a parameter is passed
within the URL. It can also be used to determine if the user
has entered data in form fields prior to the form post action.