View Full Version : How to separate records retreived into different pages

06-22-2005, 03:52 AM

$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.


Velox Letum
06-22-2005, 05:11 AM
Take a look at this pagination tutorial (http://forums.biorust.com/archive/index.php/t-1120.html) and see if that can't help get you started. Otherwise Google it, I found 100s of tutorials on Pagination, many database driven.