$page = (int)(!isset($_GET["page"]) ? 1 : $_GET["page"]); if ($page <= 0) $page = 1; $per_page = 15; // Set how many records do you want to display per page. $startpoint = ($page * $per_page) - $per_page; $statement = "`sales` ORDER BY `invoice` ASC"; // Change `records` according to your table name. $results = mysqli_query($conDB,"SELECT * FROM {$statement} LIMIT {$startpoint} , {$per_page}"); echo "
| Date | Invoice No | Customer | Amount | Paid | Balance | Comments | Actions | "; echo "
|---|---|---|---|---|---|---|---|
| ".$row['sale_time']." | ".$row['invoice']. " | " .$row['customer_name']. " | " .$row['payment']. " | ".$row['received']. " | ".$row['balance']. " | ".$row['comments']. " | Detail"; echo " |
"; // displaying paginaiton. echo pagination($statement,$per_page,$page,$url='?'); ?>