ColdFusion
  Home arrow ColdFusion arrow Page 3 - Jump Start To ColdFusion MX
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
COLDFUSION

Jump Start To ColdFusion MX
By: Clint Tredway
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2002-09-24

    Table of Contents:
  • Jump Start To ColdFusion MX
  • What Is ColdFusion?
  • Showing The Results Of A Query
  • Looping In ColdFusion
  • Form Handling
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Jump Start To ColdFusion MX - Showing The Results Of A Query


    (Page 3 of 6 )

    Ok, now that we know how to query a database, let's see how we can show the results of that query. Remember the <cfoutput> tag we talked about earlier in this article? This tag will loop through a recordset when the query attribute is used. Here's how to set up the output of our query from earlier:

    <cfoutput query="myQuery">
    #col1# #col2#<br>
    </cfoutput>


    That's all you have to do to output a result set from a query -- It's that simple! Any HTML tag can be placed inside a <cfoutput> tag as well. For example:

    <cfoutput query="myQuery">
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td>#col1#</td>
    <td>#col2#</td>
    <tr>
    </table>
    </cfoutput>


    The <cfoutput> tag is a very powerful tag that has many cool features that are beyond the scope of this article. I will compose a more advanced article with these features explained in depth another day.

    On the Winodws platform variables are not case sensitive. So myquery and myQuery refer to the same variable. You can have the same variable in different scopes though. I would not recommend doing this, but it is possible. For instance, you can have form.myvar and url.myvar, but this is not good coding practice -- I just wanted to state that it was indeed possible.

    Sending Email
    Sending email is a very common task that many developers have to do in many of the applications we build. In ColdFusion, sending email is very simple. Just like the other tags that we have used previously in this article, this tag is called what it does; <cfmail>. The <cfmail> tag is what allows developers to send email through their applications. Here is how to use this tag:

    <cfmail from="me@me.com" to="you@you.com" subject="This is an email from ColdFusion">
    Hello From ColdFusion MX!
    </cfmail>


    This will send an email to the 'to' address with the body of 'Hello From ColdFusion MX'. There are other attributes that this tag can use are bcc, cc, type (text or HTML), query, timeout, startrow, endrow, and many others. This is a powerful tag but it was not design to be a mail-sending engine -- there are third-party mail tags that are much better than the default <cfmail> tag but at least you do not have to buy a third-party tool to send mail out of the box.

    More ColdFusion Articles
    More By Clint Tredway


     

    COLDFUSION ARTICLES

    - How to Access a SQL Anywhere Database with C...
    - CFXML: Probing XMLDOM in ColdFusion
    - Creating a Web Service with ColdFusion: the ...
    - CFAjax: What it is and How to Use it
    - Querying SQL 2000 Server from ColdFusion
    - Introduction to ColdFusion Markup Language, ...
    - Introduction to ColdFusion Markup Language
    - Databases and Dreamweaver MX 2004, concluded
    - Databases and Dreamweaver MX 2004
    - Welcome to Coldfusion MX 6.1, concluded
    - Welcome to Coldfusion MX 6.1
    - What You Must Know About ColdFusion Flow-Con...
    - What You Must Know About Operators in ColdFu...
    - Everything You Must Know About ColdFusion Va...
    - My First Application on ColdFusion MX Server







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway