Accessibility

ColdFusion Article

 

Displaying database data on a web page


Sue Hove

Sue Hove

Adobe

Table of Contents

Created:
1 April 2002
Modified:
30 July 2007
User Level:
Beginner

The strength of Adobe ColdFusion lies in its ability to connect to many types of data sources and display that information dynamically on web pages. One strong application is exemplified by selling products on a website. If you were to use static web pages instead of ColdFusion, you'd have to create a new web page for every product you'd like to sell. Usually, that data already resides in a data source of some kind. Using CFML, you can query product information in your database quickly and easily, and dynamically create a detailed product web page based on your customer's request.

In order to connect to a database, retrieve data, and display it on a web page, you must do the following:

  1. Create a connection to the database.
  2. Write a ColdFusion page which contains the following two tags:

    • The cfquery tag, which contains the SQL SELECT statement to retrieve the data from the database
    • The cfoutput tag, which displays the query output on the web page

This article explains how to display database data on a web page.

Requirements

To complete this tutorial you will need to install the following software:

ColdFusion

About the author

Sue Hove is the senior manager of Instructor Certification at Adobe, Inc. She has worked on the ColdFusion authorized curriculum since 1996, when she joined Allaire, was part of the acquisition by Macromedia and then became part of Adobe. She has a Computer Science degree and a background in relational database design and implementation, corporate training, and consulting.