oops, I accidentally posted this as a reply to the wrong string... let's try
again :P


it surprises me that nobody has mentioned the CEILING() function...

If you just want to know how many pages there will be do this:


-------------------------------------
<cfset maxRows = 10>(this is whatever you have it set to in your code)

<cfset pages = ceiling(qname.recordcount/maxRows)>

-------------------------------------

the CEILING() function rounds up no matter what, so if you have recordcount
of 11 and divide by ten you will get 1.1 then CEILING() will round up to 2.

    

                                                    
Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]
                                                    


-----Original Message-----
From: Hayes, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 10:57 AM
To: CF-Talk
Subject: RE: Determining no. of pages in results


You can check query_name.CurrentRow as you are outputting the query. The
page number is CurrentRow/10.

-----Original Message-----
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 12:43 PM
To: CF-Talk
Subject: Determining no. of pages in results


Hi,

I have a query which searches a table, and displays results, 10 at a time.
How can I display the page-numbers though, so users can scroll through to a
page further along the query (1,2,3,4 etc)?

To get the number of pages, all I've done is:

<cfset noPages = round(getads.recordcount / 10>

Any ideas?

Thanks.

Will
--
[EMAIL PROTECTED] -=- www.lukrative.com
Local-Advertising -=- www.localbounty.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to