// how many rows to show per page $rowsPerPage = 50; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; //gets number from url } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $conn = new PDO("sqlite:eurotech3.sdb"); $sql = "SELECT COUNT(*) FROM parts WHERE supp = 'ETRS' AND qty>0"; foreach ($conn->query($sql) as $totalcount) { //echo $totalcount['0'] ; }; $numrows = $totalcount['0'] ; $sql = "SELECT * FROM parts WHERE supp = 'ETRS' AND qty>0 ORDER BY part1 LIMIT $offset, $rowsPerPage"; $maxPage = ceil($totalcount['0']/$rowsPerPage); $self = $_SERVER['PHP_SELF']; ?>
Click the product to see more details.
SELECT | PART | MANUFACTURER | QTY |
---|---|---|---|
echo "$buttonurl2" ?> class="btn btn-default-transparent btn-hvr hvr-shutter-out-horizontal" role="button">Select | print " "."" .$row['part2'] .""; //urlencode() is used to allow 'illegal characters' in part number such a hash # symbol?> print " " .$row['desc']; ?> | print " " .$row['man'];?> | print " " .$row['qty'];?> | } ?>
echo "$numrows"; ?> Records found matching echo "$man"; ?>
$offsetx = $offset + 1; $offsety = $offset + $rowsPerPage; if ($offsety > $numrows) { echo "