Was wondering if anyone can see anything wrong with my code here. It supposed to bring up a reulst page which is limited to 10 results at a time, with a newxt and previous link to navigate to other records. The end result, when the form returns the Country variable, is a line of the link "Next" instead of displaying the results. There are as many Next links as there are Countries. E.g If the search was for South Africa, and there were 13 in the database, 13 Nexts would be displayed. Here is my code. Sorry about the length but I don't want to miss anything out.----------------------------------------------------
<CFQUERY Name="DiveSearch" DATASOURCE="DiveSchools">
Select *
From DiveData
Where Country='#Country#'
</CFQUERY>
<CFPARAM NAME="CountR" DEFAULT="1">
<HEAD><TITLE>Search Results</TITLE></HEAD>
<BODY>
<CFOUTPUT QUERY="DiveSearch">
<CFIF CountR GT 1>
<CFSET Prev=CountR - 10>
<CFIF Prev LT 1><CFSET Prev=1></CFIF>
<A HREF="SearchResults.cfm?CountR=#Prev#>Previous Page</A>
</CFIF>
<CFIF CountR LT (DiveSearch.RecordCount - 9)>
<CFSET Next=CountR+10>
<CFIF Next GT DiveSearch.Recordcount><CFSET Next=DiveSearch.recordcount-1></CFIF>
<A HREF="SearchResults.cfm?CountR=#Next#>Next Page</a>
</CFIF>
<CFSET Start=CountR>
<CFIF Start LT 1><CFSET Start=1></CFIF>
<CFIF Start GT DiveSearch.RecordCount><CFSET Start=DiveSearch.RecordCount></CFIF>
<CFSET End=CountR+9>
<CFIF End GT DiveSearch.recordCount><CFSET End=DiveSearch.RecordCount></CFIF>
<CFLOOP From=#Start# to=#End# INDEX=SearchResultLoop>
#OrgName#, #Country#, #Email# #City#<p>
</CFLOOP>
<CFIF CountR GT 1>
<CFSET Prev=CountR - 10>
<CFIF Prev LT 1><CFSET Prev=1></CFIF>
<A HREF="SearchResults.cfm?CountR=#Prev#>Previous Page</A>
</CFIF>
<CFIF CountR LT (DiveSearch.RecordCount - 9)>
<CFSET Next=CountR+10>
<CFIF Next GT DiveSearch.Recordcount><CFSET Next=DiveSearch.recordcount-1></cfif>
<A HREF="SearchResults.cfm?CountR=#Next#>Next Page</a>
</CFIF>
</CFOUTPUT>
</BODY>
<CFQUERY Name="DiveSearch" DATASOURCE="DiveSchools">
Select *
From DiveData
Where Country='#Country#'
</CFQUERY>
<CFPARAM NAME="CountR" DEFAULT="1">
<HEAD><TITLE>Search Results</TITLE></HEAD>
<BODY>
<CFOUTPUT QUERY="DiveSearch">
<CFIF CountR GT 1>
<CFSET Prev=CountR - 10>
<CFIF Prev LT 1><CFSET Prev=1></CFIF>
<A HREF="SearchResults.cfm?CountR=#Prev#>Previous Page</A>
</CFIF>
<CFIF CountR LT (DiveSearch.RecordCount - 9)>
<CFSET Next=CountR+10>
<CFIF Next GT DiveSearch.Recordcount><CFSET Next=DiveSearch.recordcount-1></CFIF>
<A HREF="SearchResults.cfm?CountR=#Next#>Next Page</a>
</CFIF>
<CFSET Start=CountR>
<CFIF Start LT 1><CFSET Start=1></CFIF>
<CFIF Start GT DiveSearch.RecordCount><CFSET Start=DiveSearch.RecordCount></CFIF>
<CFSET End=CountR+9>
<CFIF End GT DiveSearch.recordCount><CFSET End=DiveSearch.RecordCount></CFIF>
<CFLOOP From=#Start# to=#End# INDEX=SearchResultLoop>
#OrgName#, #Country#, #Email# #City#<p>
</CFLOOP>
<CFIF CountR GT 1>
<CFSET Prev=CountR - 10>
<CFIF Prev LT 1><CFSET Prev=1></CFIF>
<A HREF="SearchResults.cfm?CountR=#Prev#>Previous Page</A>
</CFIF>
<CFIF CountR LT (DiveSearch.RecordCount - 9)>
<CFSET Next=CountR+10>
<CFIF Next GT DiveSearch.Recordcount><CFSET Next=DiveSearch.recordcount-1></cfif>
<A HREF="SearchResults.cfm?CountR=#Next#>Next Page</a>
</CFIF>
</CFOUTPUT>
</BODY>