Solved

Recordset counter

Posted on 2011-03-10
2
346 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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 …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 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