482
CFML Language Reference
<P>After populating the query, the example shows, in tabular format, the
contents of the columns.</P>
<!--- make a new query --->
<CFSET myQuery = QueryNew("")>
<!--- create an array --->
<CFSET FastFoodArray = ArrayNew(1)>
<CFSET FastFoodArray[1] = "French Fries">
<CFSET FastFoodArray[2] = "Hot Dogs">
<CFSET FastFoodArray[3] = "Fried Clams">
<CFSET FastFoodArray[4] = "Thick Shakes">
<!--- add a column to the query --->
<CFSET nColumnNumber = QueryAddColumn(myQuery, "FastFood",
FastFoodArray)>
<!--- create a second array --->
<CFSET FineCuisineArray = ArrayNew(1)>
<CFSET FineCuisineArray[1] = "Lobster">
<CFSET FineCuisineArray[2] = "Flambe">
<!--- add a second column to the query --->
<CFSET nColumnNumber2 = QueryAddColumn(myQuery, "FineCuisine",
FineCuisineArray)>
<!--- create a third array --->
<CFSET HealthFoodArray = ArrayNew(1)>
<CFSET HealthFoodArray[1] = "Bean Curd">
<CFSET HealthFoodArray[2] = "Yogurt">
<CFSET HealthFoodArray[3] = "Tofu">
<!--- add a third column to the query --->
<CFSET nColumnNumber3 = QueryAddColumn(myQuery, "HealthFood",
HealthFoodArray)>
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<th align="left">Fast Food</th>
<th align="left">Fine Cuisine</th>
<th align="left">Health Food</th>
</tr>
<CFOUTPUT query="myQuery">
<tr>
<td>#FastFood#</td>
<td>#FineCuisine#</td>
<td>#HealthFood#</td>
</tr>
</CFOUTPUT>
</table>
<P><B>Note:</B> Because there are fewer elements in the Fine Cuisine and
Health Food arrays, QueryAddColumn
added padding to the corresponding columns in the query.</P>
</BODY>
</HTML>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...