Manual munging
\n";
$dbh = pg_connect("dbname=ipdb user=ipdb password=ipdbpwd");
/* Since there are so many records in this table, we'll only display 50 at a time.
** We want to remember where we were without complex CGI variable-passing or other
** headaches, so we just stuff it in the db.
*/
if (!isset($ofs)) {
$qu = pg_exec($dbh, "select * from temp");
if (pg_NumRows($qu) == 0) {
print "Using default limit";
$ofs = 0;
} else {
$data = pg_fetch_array($qu, 0);
$ofs = $data[0];
print "Limit $ofs found";
}
} else {
print "Passed limit $ofs in CGI
\n";
$qu = pg_exec("delete from temp");
$qu = pg_exec("insert into temp values ($ofs)");
}
?>
$qu = pg_exec($dbh, "select count(*) from allocations");
$data = pg_fetch_array($qu,0);
$nrows = $data[0];
$ofnum = (integer) ($nrows / 50);
for ($i=0; $i<=$ofnum; $i++) {
print ''."$i - ";
}
?>
CIDR allocation | CustID | Alloc type | City | Description | Notes |
$qu = pg_exec($dbh, "select * from allocations order by cidr limit 50 offset $ofs");
$row = 0;
for ($row=0; $row < pg_NumRows($qu); $row++) {
$data = pg_fetch_array($qu, $row);
print "\n";
}
?>
// include '../footer.inc';
?>