ColdFusion MX: Displaying Database Data

In my previous article we set up our ColdFusion MX environment, learned some basics on ColdFusion and created a sample page using some simple tags and functions.  The page itself was a fancy “hello world” example with few lines of code. 

The truly great thing I love about ColdFusion is that you can do really great things with few lines of code.  One of the things that impressed me most was how easy it was to retrieve information from a database and display that data.  Even though ColdFusion has changed so much over the years, it’s still very simple to connect to a database, retrieve data and display that data.  This is what we will accomplish in this article.

In this article, we’re going to work with ColdFusion MX and explore the following tasks:

  • Deciding on the database: MySQL 4.1.8 & MySQL Administrator (for Windows)
  • Installing MySQL and MySQL Administrator
  • Setting up the Database
  • Creating the Data Source Name (DSN)
  • Querying a Database Table
    • Basic Select Statement
    • Using the CFDump tag
    • Dreamweaver Recordset Builder
    • Understanding the Result Set
  • Displaying Database Data
  • Dynamic Table Tool
  • Additional Query Information

These are the basic tasks necessary to setting up a database for use and then writing ColdFusion code to query that database and display data.  You will see some insight into the dot notation that is being used in ColdFusion as well as additional information about MySQL and recordsets.

$2.89
- OR -

Rob Sherman

Rob ShermanRob Sherman Bio:
Attended Fullerton College for a BS in Computer Science and began designing web pages in 1991. In 1994 he began working for an Internet Service Provider called Compulearn in Tarzana, CA. While there he began teaching various computer classes like Access, Word, Excel and Internet related courses. Aside from teaching he became the Webmaster for Compulearn and started designing website for Compulearn and it’s clients. Some of those clients included: Arco, Gilette, Vision Correction Centers, various legal and insurance offices, AT & T, San Fernando Valley Bar Association, a teen website called Moxiegirl, State of Arizona, and the United States Commerce Department.

Rob also decided to take on other responsibilities and worked for a non-profit organization called the Global Schoolhouse Foundation in 1997. This non-profit organization had a mission of bringing Internet technology into the classrooms for both students and teachers. The work this foundation performed was even recognized by now presidential candidate Al Gore, and more recently President George W. Bush and met with the organization periodically. Rob excelled in the ColdFusion language and was building web based projects that brought teachers and students together from over 30 countries.

In 1999, Rob left the Global Schoolhouse to take on the title of Director of Development for an online auction website located in Paris, France. This website was Eurobid.com. In February of 1999 the idea of a truly multi-lingual auction website for the European community was just a thought, but by the end of that same year it became a reality. While continuing to work from the states, Rob put together a team of ColdFusion developers across the U.S. as well as system administrators and was responsible for architecting one of the strongest auction communities in all Europe.

After leaving Eurobid in 2000, Rob formed his own consulting corporation, known as CFDude, Inc. and maintains several clients. He also became a Macromedia Certified Instructor (along with Macromedia Advanced Certified ColdFusion Developer) teaching courses for Andrew’s Technology all over the U.S. and later taught ColdFusion MX and Flash MX 2004 classes for RoundPeg. Rob was also selected to be a part of the pilot program for the Macromedia Certified Professional Program and is one of the first Macromedia Certified Professionals. Rob presently holds the following certifications: Advanced ColdFusion Developer/Trainer; Flash MX Developer/Trainer; Flash MX 2004 Developer/Trainer.

See All Postings From Rob Sherman >>