macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

recordset functions

Subject: recordset functions
From: "900spg"
Date: Wed, 8 Aug 2007 22:45:06 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
I have created a simple photo gallery page and I'm having trouble creating the 
dynamic navigation. I have a page that contains thumbnails of all of the images 
using the following code:
 <cfquery datasource="#datasource2#" name="getphotos">
 SELECT * 
 FROM w_photos
 WHERE event = '#url.e#'
 ORDER BY ID
 </cfquery>



 <table>
 <cfset startRow=#StartRow_getphotos#>
        <cfset j = Ceiling(#getphotos.recordcount#/3)>
                <cfloop index="LoopCount" from="1" to="#j#">
        <tr>
                
                        
                                 <cfoutput query="getphotos" 
startRow="#StartRow#" 
maxRows="#MaxRows_getphotos#"><td align="center"><a 
href="displayimage.cfm?f=#getphotos.filename#&i=#getphotos.id#" 
class="text"><img src="/ac/images/galleryimages/thumbs/#getphotos.filename#" 
align="middle"></a></td></cfoutput>
                        
                
                        
                                        
        </tr>
        <cfset startrow=(#StartRow#+3)>
                </cfloop>
 </table>

 So on my displayimage.cfm page I would like to be able to provide next and 
previous navigation links that allow the user to  move forward or back through 
the full size images based on the order that the thumbnails were displayed on 
the previous page. I originally thought that I could use the id field and add 
orsubtract 1 value but that will not work as the next or previous id may be 
more than one unit away. Is there any function that will let me call the next 
or previous record in the recordset? Thanks in advance for any help. 


<Prev in Thread] Current Thread [Next in Thread>