Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to separate records retreived into different pages

    Hi,

    $callDetailsSQL ="select calls.date as date, calls.time as time, ceil(calls.duration_incoming/60) as incoming_duration, ceil(calls.duration_outgoing/60) as outgoing_duration, calls.did as mobile, calls.cli as cli, calls.destination as destination, round(calls.rate_incoming+calls.rate_outgoing,2) as rate, round(calls.amount,2) as charge from calls, useraccounts, billingaccounts where calls.amount>0 and calls.did=useraccounts.mobile and useraccounts.billingid=billingaccounts.id and useraccounts.billingid='";

    $callDetailsSQL .= $billingid."' and month(date)='";
    $callDetailsSQL .= $Month."' and year(date)='";
    $callDetailsSQL .= $Year."' order by calls.call_id desc";

    using the above SQL, I generate a list of records, so how can I generate previous links and next links so that in each page I can only see a maximum of 20 records.

    thks

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Take a look at this pagination tutorial and see if that can't help get you started. Otherwise Google it, I found 100s of tutorials on Pagination, many database driven.
    "$question = ( to() ) ? be() : ~be();"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •