MACROMEDIA COLDFUSION 5-DEVELOPING Bedienungsanleitung Seite 31

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 47
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 30
ColdFusion MX 7 Getting Started Experience Tutorial Page 31 of 47
Learning Point: ColdFusion code never reaches the browser
All CFML is stripped out of the page after ColdFusion MX 7 processes it. This ensures that the CFML never displays in
the browser, which it is not programmed to understand. If you ever see any CFML in your HTML pages, you know that
something is wrong with your code!
The cfquery tag connects to the cftutorial data source, and returns the data in the artwork variable declared
in the name argument. So why isn’t anything showing up on the page? You need to add code to actually display the
data.
5. Use the cfdump debugging tag to see what is being stored in the artwork variable. Simply pass the variable name
into the var attribute of the tag.
<cfquery name="artwork" datasource="cftutorial">
SELECT FIRSTNAME, LASTNAME, ARTNAME, DESCRIPTION, PRICE, LARGEIMAGE, ISSOLD, MEDIATYPE
FROM ARTISTS, ART, MEDIA
WHERE ARTISTS.ARTISTID = ART.ARTISTID
AND ART.MEDIAID = MEDIA.MEDIAID
</cfquery>
<cfdump var="#artwork#">
Learning Point: Number (#) signs
This is the first time you have encountered the ColdFusion use of number signs in your code. In this case, they are used
around a variable to tell ColdFusion not to literally display the word artwork, but rather, display what is stored in the
artwork variable. Try it with and without the number signs to see what happens.
6. Save and then browse the page again to see the results of the cfdump tag.
Figure 49. Query result set
shown using the cfdump
debugging tool
Learning Point: cfdump
cfdump is a useful debugging tool that allows you to quickly determine the contents of a complex variable like this query
resultset.
Seitenansicht 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 46 47

Kommentare zu diesen Handbüchern

Keine Kommentare