Hope this helps
<html>
<head>
<title>Frequently Asked Questions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="FAQStylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<img src="RMA.JPG" width="960" height="63">
<hr><hr>
<H2>FREQUENTLY ASKED QUESTIONS</H2>
<hr>
<form action="search.cfm" method="post">
<input type="submit" name="Search" value="Search FAQ">
</form>
<cfquery name="getfaq" datasource="#application.dsn#">
Select *
from games
order by game desc
</cfquery>
<cfparam name="URL.PageIndex" default="0">
<cfif IsDefined("Getfaq.RecordCount")>
<cfif NOT IsDefined("FORM.CurrentPage")>
<cfset variables.CurrentPage = 1>
<cfelse>
<cfset variables.CurrentPage = FORM.CurrentPage>
</cfif>
<!--- Calculate the total number of pages. --->
<cfscript>
variables.ItemsPerPage = 5;
if (Getfaq.RecordCount LT variables.ItemsPerPage)
variables.TotalPages = 1;
else
variables.TotalPages = NumberFormat(GetFaq.RecordCount / variables.ItemsPerPage, 9999);
</cfscript>
<!--- Since the rounding up doesn't work, if there are items left over for an extra page, add it here. --->
<cfif Getfaq.RecordCount - (variables.TotalPages * 100) GT 0>
<cfset variables.TotalPages = variables.TotalPages + 1>
</cfif>
<!--- Check to make sure the user doesn't try to go beyond the Total number of pages. --->
<cfif variables.CurrentPage GT variables.TotalPages>
<cfset variables.CurrentPage = variables.TotalPages>
</cfif>
<!--- Calculate the Start and End points for the Items Query. --->
<cfscript>
variables.Start = (variables.CurrentPage * variables.ItemsPerPage) - 4;
variables.End = (variables.CurrentPage * variables.ItemsPerPage);
</cfscript>
</cfif>
<cfif IsDefined("Getfaq.RecordCount")>
<script language="JavaScript">
function validateform_gotobreadcrumb (f) {
if (f.CurrentPage.value == "") {
alert("Please enter a page number before clicking the GO button.");
return false;
}
return true;
}
function GoToPageN() {
if (validateform_gotobreadcrumb(document.viewPage)) document.viewPage.submit();
}
function SortList(sortorder) {
document.viewPage.SortOrder.value = sortorder;
document.viewPage.CurrentPage.value = 1;
if (validateform_gotobreadcrumb(document.viewPage)) document.viewPage.submit();
}
</script>
<cfif variables.TotalPages GT 1>
<strong><cfoutput>#Getfaq.RecordCount#</cfoutput> total items found.</strong>
<form action="test.cfm" method="post" name="viewPage">
View Page: <select name="CurrentPage"><cfloop from="1" to="#variables.TotalPages#" index="i"><cfoutput><option value="#i#"<cfif variables.CurrentPage IS i> selected</cfif>>#i#</option></cfoutput></cfloop></select> <strong>of <cfoutput>#variables.TotalPages#</cfoutput></strong> <input type="Button" value="Go" onclick="GoToPageN();">
</form>
</cfif>
</cfif>
<cfoutput>
<cfloop query="getfaq" startrow="#variables.Start#" endrow="#variables.End#">
<Strong>Qusetion#getfaq.game# :
#getfaq.week#</Strong>
<Strong>Answer:</Strong> <h4>#getfaq.home_team#</h4>
<cfif start eq end>
<cfbreak>
</cfif>
</cfloop>
</cfoutput>
</body>