Ok I'm relatively new to CF so this may sound stupid. I set up a query to
retreive my data from the database. I had it displaying just fine on the page.
I tried using DMX04's built in "recordset paging" button to try and limit the
results to 10 per page and have the typical "next, previous, etc." buttons.
Well Dreamweaver added them but it's not working and the code it wrote is a
little beyond me at this time. Hopefully someone will be kind enough to point
out any adjustments I need to make to this sort of thing, I'd greatly
appreciate it. Here's my code.



<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfparam name="PageNum_getImages" default="1">
<cfquery name="getImages" datasource="Rotate_Gallery">
SELECT *
FROM gallery
ORDER BY ID ASC
</cfquery>
<cfset MaxRows_getImages=10>
<cfset
StartRow_getImages=Min((PageNum_getImages-1)*MaxRows_getImages+1,Max(getImages.R
ecordCount,1))>
<cfset
EndRow_getImages=Min(StartRow_getImages+MaxRows_ge tImages-1,getImages.RecordCoun
t)>
<cfset TotalPages_getImages=Ceiling(getImages.RecordCount/MaxRows_getImages)>
<cfset QueryString_getImages=Iif(CGI.QUERY_STRING NEQ
"",DE("&"&XMLFormat(CGI.QUERY_STRING)),DE("")) >
<cfset
tempPos=ListContainsNoCase(QueryString_getImages," PageNum_getImages=","&")>
<cfif tempPos NEQ 0>
<cfset QueryString_getImages=ListDeleteAt(QueryString_get Images,tempPos,"&")>
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Doent</title>
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
#wrap {
width: 150px;
float: left;
}
#frame {
padding: 0px;
margin: 0px;
}
img {
margin-top: 4px;
margin-left: 4px;
padding: 0px;
}
</style>
</head>
<body>
<div id="wrap">
<cfoutput query="getImages">
<a href="#full_pic#" target="picFrame"><img src="#pic_thumb#"
height="#pic_y#" width="#pic_x#" border="1" /></a>
</cfoutput>
<br />
<cfoutput>
<cfif PageNum_getImages GT 1>
<a href="#CurrentPage#?PageNum_getImages=1#QueryStrin g_getImages#">First</a>
</cfif>
<cfif PageNum_getImages GT 1>
<a
href="#CurrentPage#?PageNum_getImages=#Max(Decreme ntValue(PageNum_getImages),1)#
#QueryString_getImages#">Previous</a>
</cfif>
<cfif PageNum_getImages LT TotalPages_getImages>
<a
href="#CurrentPage#?PageNum_getImages=#Min(Increme ntValue(PageNum_getImages),Tot
alPages_getImages)##QueryString_getImages#">Next</a>
</cfif>
<cfif PageNum_getImages LT TotalPages_getImages>
<a
href="#CurrentPage#?PageNum_getImages=#TotalPages_ getImages##QueryString_getImag
es#">Last</a>
</cfif>
</cfoutput>
</div>
<div id="frame">
<iframe src="" name="picFrame" width="350px" height="350px" frameborder="0"
scrolling="no"></iframe>
</div>
</body>
</html>