pg_fetch_all
(PHP 4 >= 4.3.0, PHP 5)
pg_fetch_all — 从结果中提取所有行作为一个数组
<h3>说明</h3>
array <strong>pg_fetch_all</strong>
( resource <code>$result</code>
)
<p>
<strong>pg_fetch_all()</strong>
从结果资源中返回一个包含有所有的行(元组/记录)的数组。如果没有更多行可供提取,则返回 <strong><code>FALSE</code></strong>。
</p>
<p>
<p><strong>Example #1 <strong>pg_fetch_all()</strong> 例子</strong></p>
<?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);
?>
</p>
<p>
参见 pg_fetch_row(),pg_fetch_array(),pg_fetch_object()
和 pg_fetch_result()。
</p>