Got PTID $ptid

\n"; $result = pg_query ($dbi, "SELECT type as bob FROM placetype WHERE ptid = '$ptid'"); if (pg_num_rows ($result) == 1) { $list = pg_fetch_array ($result); $out = "

Place type $ptid is ".$list['bob']."

\n"; } else { $out = "

Sorry - no such placetype known

\n"; } return $out; } /* ptdetails () */ if (isset ($_GET['PTID'])) { echo ptdetails ($_GET['PTID']); } else { $result = pg_query ($dbi, "SELECT ptid, type FROM placetype"); echo "\n"; for ($i = 0; $i < pg_num_rows ($result); $i++) { list ($ptid, $type) = pg_fetch_row ($result, $i); echo "\n"; } echo "
$ptid$type
\n"; } ?>