<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HTML//EN">
<!-- DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" -->
<html><head><title>UTF-8</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body>
<?php

$dbr = @pg_pconnect("dbname=chlor");
if ($dbr) {
	$sql = "SELECT * FROM protocol";
	$res = pg_query($dbr, $sql);
	if ($res) {
		$i = 0;
		$count = pg_numrows($res);
		echo "<pre>";
		while ($i < $count) {
			$row = pg_fetch_row($res, $i++);
			for ($n=0; $n<count($row); $n++) {
				echo "$row[$n] ";
			}
			echo "\n";
		}
		echo "</pre>";
		pg_free_result($res);
	}
	pg_close($dbr);
} else {
	echo "<h1>Fail</h1>";
}

?></body></html>
