Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of ColdFusion 9
  • Discussion

  • Study Guides

  • Table of Contents

Bookmark and Share

Start Learning Now

Our free lessons will get you started (Adobe Flash® required).
Get immediate access to our entire library.

Sign up for Educator.com

Membership Overview

  • Unlimited access to our entire library of courses.
  • Search and jump to exactly what you want to learn.
  • *Ask questions and get answers from the community and our teachers!
  • Practice questions with step-by-step solutions.
  • Download lesson files for programming and software training practice.
  • Track your course viewing progress.
  • Download lecture slides for taking notes.
  • Learn at your own pace... anytime, anywhere!

Getting Data from the Database

  • Print out resultset values using a <cfoutput> block
  • Surround vars with #'s
    <cfquery datasource="ftcf700_artgallery" name=”qArtists”>
    	SELECT ARTISTS.ARTISTID, ARTISTS.FIRSTNAME, ARTISTS.LASTNAME
    	FROM ARTISTS ORDER BY LASTNAME
    </cfquery>
    <cfoutput> #ARTISTID# #FIRSTNAME# #LASTNAME#
    </cfoutput> *only shows 1 row being returned
    	
  • CFOutput tag with the Query attribute creates a looping statement
  • To show all rows returned, add the query attribute to the <cfoutput> tag
  • Executes once for every row returned in the assigned query
    
    	<cfoutput query="query name"> ...</cfoutput>