
Using a web page to list trips
65
To enhance the query results:
1
To sort the trip names in alphabetical order in the triplisting.cfm page, modify the SQL
SELECT statement within the
cfquery
tags as follows:
SELECT tripName FROM trips ORDER BY tripName
2
To display the departure, return date, and price for each trip, modify the same SQL statement.
a
Modify the SQL SELECT statement, as follows:
SELECT tripName, departureDate, returnDate, price
FROM trips
ORDER BY tripName
b
Change the output block (the code immediately preceding the
</cfoutput>
tag) from just
#tripName#
to include all three selected fields, as follows:
#tripName# departs: #departureDate# returns: #returnDate# price:
#price#<BR>
3
Create the Budget Trip List report by doing the following:
a
Modify the SQL SELECT statement, as follows:
SELECT tripName, departureDate, returnDate, price
FROM trips
WHERE price <= 1500
ORDER BY tripName
b
Change the heading tag from
<h1>Trip List</h1>
to
<h1>Budget Trip List</h1>
.
4
View the triplisting.cfm in a browser and verify that all the new requirements were met. The
revised TripListing.cfm page looks like this:
Note that the dates and prices in the preceding listing are not formatted. In
Lesson 3: Creating
a Main Application Page
, you will enhance the look of this page.
Содержание COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION...
Страница 1: ...Getting Started Building ColdFusion MX Applications...
Страница 6: ...6 Contents...
Страница 10: ......
Страница 30: ...30 Chapter 2 CFML Basics...
Страница 36: ...36 Chapter 3 Database Fundamentals...
Страница 48: ......
Страница 76: ...76 Chapter 6 Lesson 2 Writing Your First ColdFusion Application...
Страница 134: ...134 Index...