User Guide

4 Contents
CHAPTER 3: Database Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Understanding database basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
What is a relational database? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Understanding relational tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
About SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Using SQL to interact with a database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Using SQL with ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
About data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Writing SQL and CFML statements to interact with a data source. . . . . . . . . . 35
CFML tags that interact with a database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
CHAPTER 4: Configuring Your Development Environment . . . . . . . . . . . . . . . . . 37
Verifying the tutorial file structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Configuring database connection and debugging options . . . . . . . . . . . . . . . . . . . 39
Configuring the connection to the sample database file . . . . . . . . . . . . . . . . . . 39
Enabling debugging options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Macromedia development environment tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
The Dreamweaver MX environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Configuring Dreamweaver MX for ColdFusion development. . . . . . . . . . . . . . 46
Configuring HomeSite+ for ColdFusion development . . . . . . . . . . . . . . . . . . . 46
PART II: Building a ColdFusion Application
CHAPTER 5: Lesson 1: Preparing to Build the Sample Application . . . . . . . . . . . 49
Application development steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Determining the application functional requirements . . . . . . . . . . . . . . . . . . . . . . 50
Determining the data requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Designing the database for your application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Developing the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
How to proceed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
CHAPTER 6: Lesson 2: Writing Your First ColdFusion Application . . . . . . . . . . . 57
Creating your first ColdFusion application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Application development steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Using a web page to list trips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Converting to a dynamic web page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Using SQL with cfquery to dynamically retrieve information . . . . . . . . . . . . . . 62
Creating a dynamic web page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Developing a search capability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Designing the search criteria page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Building the Search Results page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Completing the Trip Search Results page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
In the next lesson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75