Database Reference
In-Depth Information
Figure 14.14
Downloading MyODBC.
This is the CFQUERY tag. Each query needs a name, as you can use many queries within
a template. The query also needs the name of the data source that it is to connect to. The
text inside the tag is the actual SQL query. Unlike our ASP example earlier, all of the code
for connecting to the data source and sending the query is hidden from the web developer.
To access the results of the query, we use the <CFOUTPUT> tag with a query attribute
that refers to the name specified in the <CFQUERY> earlier:
<CFOUTPUT query=”getusers”>
<CFOUTPUT> in this form will loop through the code inside it for every row of the
query results. If there are no rows returned, processing continues from after the </CFOUT-
PUT> tag. Inside our tag we use the following:
#USER#@#HOST#<BR>
Figure 14.15
Downloading MyODBC.
Search WWH ::




Custom Search