Solved

Recordset counter

Posted on 2011-03-10
2
355 Views
Last Modified: 2013-12-24
When you using recordset paging how do you display on the page the page number out of the total count number and the record number out of the total count.

Example
Page # 5 out of 35
Record 20 out of 765

I would also like to do some thing like this if I could
1..(5)...35
0
Comment
Question by:overcolor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 35098514
0
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 500 total points
ID: 35098692
Adding the page numbers is simple. Just use the #perPage# value from the example. If you're showing 10 records per page:

      <cfset perPage    = 10>

The total pages is:
        <cfset totalPages = ceiling(yourQuery.recordCount / perPage)>

The starting record determines the current page number:
       <cfset thisPage   = ceiling(url.start / perPage)>

<cfoutput>
     perPage = #perPage#<br>
     totalPages = #totalPages#<br>
     thisPage = #thisPage#<hr>
</cfoutput>
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connect to MS-SQL server from Linux/PHP 8 96
code conversion assistance required 1 34
Coldfusion : Unix Epoch Time 4 45
Domino Website - Redirection 12 98
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question