I use the following code to output a list of city, state combinations. What I am looking to add is the number of establishments in each city and display it in () at the end of each row.
Care of Calista:
<!--- setting list of cities to display--->
<cflock TIMEOUT="30" NAME="#Session.SessionID#" type="Exclusive">
<!--- Set a variable for the record count(You'll need it later.) --->
<CFSET Session.Counter="#find_bnb.RecordCount#">
<!--- Create a new array. --->
<CFSET Session.QueryResults=ArrayNew(2)>
<!--- This is where you populate the array with the query results. --->
<CFLOOP INDEX="IdxOne" FROM="1" TO="#Session.Counter#">
<CFSET Session.QueryResults[IdxOne][1]="#find_bnb.city[IdxOne]#">
<CFSET Session.QueryResults[IdxOne][2]="#find_bnb.state[IdxOne]#">
</CFLOOP>
</cflock>
At this point do I run a query in a loop checking the count of establishments in the city/state combo?
Do I store those results in this same array or a new one?
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
Care of Calista:
<!--- setting list of cities to display--->
<cflock TIMEOUT="30" NAME="#Session.SessionID#" type="Exclusive">
<!--- Set a variable for the record count(You'll need it later.) --->
<CFSET Session.Counter="#find_bnb.RecordCount#">
<!--- Create a new array. --->
<CFSET Session.QueryResults=ArrayNew(2)>
<!--- This is where you populate the array with the query results. --->
<CFLOOP INDEX="IdxOne" FROM="1" TO="#Session.Counter#">
<CFSET Session.QueryResults[IdxOne][1]="#find_bnb.city[IdxOne]#">
<CFSET Session.QueryResults[IdxOne][2]="#find_bnb.state[IdxOne]#">
</CFLOOP>
</cflock>
At this point do I run a query in a loop checking the count of establishments in the city/state combo?
Do I store those results in this same array or a new one?
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic