<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
  <refentry id="function.pg-fetch-all">
   <refnamediv>
    <refname>pg_fetch_all</refname>
    <refpurpose>Fetches all rows from a result as an array</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>pg_fetch_all</methodname>
      <methodparam><type>resource</type><parameter>result</parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>pg_fetch_all</function> returns an array that
     contains all rows (tuples/records) in result resource. It returns
     &false;, if there are no rows.
    </para>
    &database.fetch-null;
    <para>
     <example>
      <title>PostgreSQL fetch all</title>
      <programlisting role="php">
<![CDATA[
<?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);

?>
]]>
      </programlisting>
     </example>
    </para>
    <para>
     See also <function>pg_fetch_row</function>,
     <function>pg_fetch_array</function>,
     <function>pg_fetch_object</function> and
     <function>pg_fetch_result</function>.
    </para>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->