<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "An error occurred.\n";
exit;
}
$result = pg_query($conn, "SELECT title, name, address FROM authors");
if (!$result) {
echo "An error occurred.\n";
exit;
}
// 全ての著者名を配列で得る
$arr = pg_fetch_all_columns($result, 1);
var_dump($arr);
?>