System information

88 Chapter 8: Lesson 5: Creating a Trip Detail Page
12.
In the Component Location text box, enter /components/.
13.
In the Recordset name text box, enter tripDetails.
14.
In the Function text box, enter getTripDetails.
15.
In the Data source list, select CompassTravel.
16.
In the Table list, select trips.
17.
Click OK.
18.
When asked whether to include dependent files, click Yes.
19.
Click OK.
20.
In the displaytripdetail.cfc file, modify the cfquery code block by adding the highlighted text:
<cfquery name="tripDetails" datasource="CompassTravel" maxrows=1>
SELECT * FROM trips
<cfif IsDefined("URL.ID")>
WHERE tripID = #URL.ID#
</cfif>
</cfquery>
21.
Save the file.
To display the results of the query on the Trip Detail page:
1.
Open the tripdetail.cfm file.
2.
Enter or copy and paste the following cfoutput code after the cfinvoke code block:
<cfoutput query="TripDetails">
<img src="images/tripmaintenance.gif">
<table>
<tr>
<td valign="top">Trip Name:
</td>
<td>#tripName#
</td>
</tr>
<tr>
<td valign="top">Description:
</td>
<td>#tripDescription#
</td>
</tr>
<tr>
<td valign="top">Location:
</td>
<td>#tripLocation#
</td>
</tr>
<tr>
<td valign="top">Departure Date:
</td>
<td>#departureDate#
</td>
</tr>