pg_fetch_all() returns an array that contains all rows (tuples/records) in result resource. It returns FALSE, if there are no rows.
<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT * FROM authors");
if (!$result) {
echo "An error occured.\n";
exit;
}
$arr = pg_fetch_all($result);
var_dump($arr);
?>See also pg_fetch_row(), pg_fetch_array(), pg_fetch_object() and pg_fetch_result().
| This HTML Help has been published using the chm2web software. |