yohgaki Wed Oct 2 01:58:55 2002 EDT Added files: /phpdoc/en/reference/pgsql/functions pg-fetch-all.xml pg-fetch-assoc.xml pg-result-seek.xml pg-unescape-bytea.xml Log: Added pg_fetch_all(), pg_fetch_assoc(), pg_result_seek() and pg_unescape_byptea() desc.
Index: phpdoc/en/reference/pgsql/functions/pg-fetch-all.xml +++ phpdoc/en/reference/pgsql/functions/pg-fetch-all.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- 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>Fetch a row 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> <methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam> </methodsynopsis> <para> <function>pg_fetch_all</function> returns an array that contains all row (tuples/records) in result resource. It returns &false;, if there are no more rows. </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> <para> <example> <title>PostgreSQL fetch array</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, 0, PGSQL_NUM); var_dump($arr); ?> ]]> </programlisting> </example> </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 --> Index: phpdoc/en/reference/pgsql/functions/pg-fetch-assoc.xml +++ phpdoc/en/reference/pgsql/functions/pg-fetch-assoc.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 --> <refentry id="function.pg-fetch-assoc"> <refnamediv> <refname>pg_fetch_assoc</refname> <refpurpose>Fetch a row as an array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>pg_fetch_assoc</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam> </methodsynopsis> <para> <function>pg_fetch_assoc</function> returns an associative array that corresponds to the fetched row (tuples/records). It returns &false;, if there are no more rows. </para> <para> <function>pg_fetch_assoc</function> is an extended version of <function>pg_fetch_row</function>. In addition to storing the data in the numeric indices (field index) to the result array, it also stores the data in associative indices (field name) by default. </para> <para> <parameter>row</parameter> is row (record) number to be retrieved. First row is 0. </para> <para> <function>pg_fetch_assoc</function> is NOT significantly slower than using <function>pg_fetch_row</function>, while it provides a significant ease of use. </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> <para> <example> <title>PostgreSQL fetch array</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_assoc ($result, 1, PGSQL_ASSOC); echo $arr["author"] . " <- array\n"; ?> ]]> </programlisting> </example> </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 --> Index: phpdoc/en/reference/pgsql/functions/pg-result-seek.xml +++ phpdoc/en/reference/pgsql/functions/pg-result-seek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 --> <refentry id="function.pg-result-seek"> <refnamediv> <refname>pg_result_seek</refname> <refpurpose>Set internal row offset in result resource</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>pg_result_seek</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para> <function>pg_result_seek</function> set internal row offset in reuslt resource. It returns &false;, if there is error. </para> <para> See also <function>pg_fetch_row</function>, <function>pg_fetch_assoc</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 --> Index: phpdoc/en/reference/pgsql/functions/pg-unescape-bytea.xml +++ phpdoc/en/reference/pgsql/functions/pg-unescape-bytea.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.61 --> <refentry id='function.pg-unescape-bytea'> <refnamediv> <refname>pg_unescape_bytea</refname> <refpurpose> Escape binary for bytea type </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>pg_unescape_bytea</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para> <function>pg_unescape_bytea</function> unescapes string from bytea datatype. It returns unescaped string (binary). </para> <note> <para> When you SELECT bytea type, PostgreSQL returns octal byte value prefixed by \ (e.g. \032). Users are supposed to convert back to binary format by yourself. </para> <para> This function requires PostgreSQL 7.2 or later. With PostgreSQL 7.2.0 and 7.2.1, bytea type must be casted when you enable multi-byte support. i.e. <literal>INSERT INTO test_table (image) VALUES ('$image_escaped'::bytea);</literal> PostgreSQL 7.2.2 or later does not need cast. Exception is when client and backend character encoding does not match, there may be multi-byte stream error. User must cast to bytea to avoid this error. </para> </note> <para> See also <function>pg_escape_bytea</function> and <function>pg_escape_string</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 -->
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php