Exercise 6: Testing the revised Trip Search Results page

In this exercise, you will verify that the price and departureDate are now considered in the query.

To test the revised Trip Search Results page:

  1. Open the tripsearchform.cfm page in the my_app directory in your browser.
  2. In the Departure Date drop-down list box, select Before, enter 1/1/1900 as the date (specify 1900-1-1 on UNIX).
  3. Select Smaller Than, and enter 0 for the price.
  4. Click the Search button.

    Because the departure date is considered in the query, there are no rows returned.

    Note: If you planned to use many more fields as search criteria, the approach used to add departure date and price criteria to the Trip Search form is not the most elegant solution. A generic routine to handle WHERE clause string construction based on specific data types could reduce the code and be a more extensible solution than the one presented here. However, this more extensible approach is beyond the scope of this tutorial.