Hi there
I have a small CF program to display output horizontally - its working but not
properly and I cant see why
Basically I am getting the following output:
Belmont Point 1 Belmont South Point 2 Blacksmiths Point 2 Caves Beach Point
2
Belmont South Point 2 Blacksmiths Point 2 Caves Beach Point
2
Belmont South Point 2 Blacksmiths Point 2 Caves Beach Point
2
Belmont South Point 2 Blacksmiths Point 2 Caves Beach Point
2
IT only ever goes through the first 4 records NOT the entire 15 records in the
file
Any ideas would be appreciated (Its probably something dumb that I have done
and not seeing
The program is shown below:
<cfquery name="rsGetSuburbs" datasource="#request.dsn#"
username="#request.dsnUsername#" password="#request.dsnPassword#">
select suburb_name
from tbl_suburbs
order by suburb_name
</cfquery>
<!--- <cfdump var="#rsGetSuburbs#"> --->
<cfset tmp1 = #rsGetSuburbs.RecordCount#>
<cfset tmpctr = 1>
<!--- TMP2 change the number after the division symbol "/" to reflect the
number of times you want something to display horizontally --->
<cfset tmp2 = #tmp1#/4>
<cfset tmp3 = #Round(tmp2)#+1>
<cfset startpoint = "1">
<!--- ENDPOINT change the value of endpoint to match the number of times you
want something to display horizontally --->
<cfset endpoint = "4">
<table border="0" align="center" cellspacing="5" cellpadding="5"
style="border-top: 1px solid #660000; border-right: 1px solid #660000;
border-bottom: 1px solid #660000; border-left: 1px solid #660000;">
<cfloop index="x" from="1" to="#tmp3#">
<tr>
<cfloop query="rsGetSuburbs" startrow="#startpoint#" endrow="#endpoint#">
<td>
<cfif tmpctr eq 1>
<cfset suburbname = rsGetSuburbs.suburb_name>
<cfoutput>#rsGetSuburbs.suburb_name# Point 1</cfoutput>
</td>
<cfset tmpctr = tmpctr + 1>
</cfif>
<cfif rsGetSuburbs.suburb_name neq suburbname>
<cfoutput>#rsGetSuburbs.suburb_name# Point 2</cfoutput>
</td>
<cfset tmpctr = tmpctr + 1>
</cfif>
</cfloop>
</tr>
<!--- ENDPOINT make this iteration of the "endpoint" variable one less then
the number you set TMP2 to be --->
<cfset endpoint = #startpoint#+3>
</cfloop>
</table>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313663
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4