mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Fix erroneous pg_result_status docs. Document pg_convert
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@185607 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
18d81f9999
commit
40dca4563b
3 changed files with 91 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<section id="pgsql.constants">
|
||||
&reftitle.constants;
|
||||
&extension.constants;
|
||||
|
@ -499,6 +499,42 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>PGSQL_CONV_IGNORE_DEFAULT</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Passed to <function>pg_convert</function>.
|
||||
Ignore default values in the table during conversion.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>PGSQL_CONV_FORCE_NULL</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Passed to <function>pg_convert</function>.
|
||||
Use SQL <literal>NULL</literal> in place of an empty <type>string</type>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>PGSQL_CONV_IGNORE_DEFAULT</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Passed to <function>pg_convert</function>.
|
||||
Ignore conversion of &null; into SQL <literal>NOT NULL</literal> columns.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.80 -->
|
||||
<refentry id='function.pg-convert'>
|
||||
<refnamediv>
|
||||
|
@ -31,6 +31,55 @@
|
|||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
PostgreSQL database connection resource.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of the table against which to convert types.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>assoc_array</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Data to be converted.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>options</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Any number of <constant>PGSQL_CONV_IGNORE_DEFAULT</constant>,
|
||||
<constant>PGSQL_CONV_FORCE_NULL</constant> or
|
||||
<constant>PGSQL_CONV_IGNORE_NOT_NULL</constant>, combined.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
An <type>array</type> of converted values, or &false; on error.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.58 -->
|
||||
<refentry id='function.pg-result-status'>
|
||||
<refnamediv>
|
||||
|
@ -55,8 +55,8 @@
|
|||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Possible return values are <constant>PGSQL_EMPTY_QUERY</constant>,
|
||||
<constant>PGSQL_COMMAND_OK</constant>, <constant>PGSQL_TUPLES_OK</constant>, <constant>PGSQL_COPY_TO</constant>,
|
||||
<constant>PGSQL_COPY_FROM</constant>, <constant>PGSQL_BAD_RESPONSE</constant>, <constant>PGSQL_NONFATAL_ERROR</constant> and
|
||||
<constant>PGSQL_COMMAND_OK</constant>, <constant>PGSQL_TUPLES_OK</constant>, <constant>PGSQL_COPY_OUT</constant>,
|
||||
<constant>PGSQL_COPY_IN</constant>, <constant>PGSQL_BAD_RESPONSE</constant>, <constant>PGSQL_NONFATAL_ERROR</constant> and
|
||||
<constant>PGSQL_FATAL_ERROR</constant> if <constant>PGSQL_STATUS_LONG</constant> is
|
||||
specified. Otherwise, a <type>string</type> containing the PostgreSQL command tag is returned.
|
||||
</para>
|
||||
|
@ -81,7 +81,7 @@ $result = pg_query($conn, "COPY authors FROM STDIN;");
|
|||
$status = pg_result_status($result);
|
||||
|
||||
// Determine status
|
||||
if ($status == PGSQL_COPY_FROM)
|
||||
if ($status == PGSQL_COPY_IN)
|
||||
echo "Copy began.";
|
||||
else
|
||||
echo "Copy failed.";
|
||||
|
|
Loading…
Reference in a new issue