1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-24 15:52:15 +01:00

Fix GH-1678: The "mode" parameter of pg_fetch_row is not documented

Instead of another copy&paste, we introduce a new XML entity.
This commit is contained in:
Christoph M. Becker
2022-07-05 18:29:50 +02:00
parent 46d4ffd454
commit cfeb14a38b
5 changed files with 17 additions and 36 deletions

View File

@@ -1820,6 +1820,14 @@ or <function>pg_pconnect</function>.
<!ENTITY pgsql.parameter.lob '<para xmlns="http://docbook.org/ns/docbook">An <classname>PgSql\Lob</classname> instance, returned by <function>pg_lo_open</function>.</para>'>
<!ENTITY pgsql.parameter.mode '<para xmlns="http://docbook.org/ns/docbook">
An optional parameter that controls how the returned <type>array</type> is indexed.
<parameter>mode</parameter> is a constant and can take the following values:
<constant>PGSQL_ASSOC</constant>, <constant>PGSQL_NUM</constant> and <constant>PGSQL_BOTH</constant>.
Using <constant>PGSQL_NUM</constant>, the function will return an array with numerical indices,
using <constant>PGSQL_ASSOC</constant> it will return only associative indices
while <constant>PGSQL_BOTH</constant> will return both numerical and associative indices.</para>'>
<!ENTITY pgsql.changelog.connection-object '<row xmlns="http://docbook.org/ns/docbook">
<entry>8.1.0</entry>
<entry>

View File

@@ -34,18 +34,7 @@
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
An optional parameter that controls
how the returned <type>array</type> is indexed.
<parameter>mode</parameter> is a constant and can take the
following values: <constant>PGSQL_ASSOC</constant>,
<constant>PGSQL_NUM</constant> and <constant>PGSQL_BOTH</constant>.
Using <constant>PGSQL_NUM</constant>, <function>pg_fetch_all</function>
will return an array with numerical indices, using
<constant>PGSQL_ASSOC</constant> it will return only associative indices
while <constant>PGSQL_BOTH</constant> will return both
numerical and associative indices.
</para>
&pgsql.parameter.mode;
</listitem>
</varlistentry>
</variablelist>

View File

@@ -55,18 +55,7 @@
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
An optional parameter that controls
how the returned <type>array</type> is indexed.
<parameter>mode</parameter> is a constant and can take the
following values: <constant>PGSQL_ASSOC</constant>,
<constant>PGSQL_NUM</constant> and <constant>PGSQL_BOTH</constant>.
Using <constant>PGSQL_NUM</constant>, <function>pg_fetch_array</function>
will return an array with numerical indices, using
<constant>PGSQL_ASSOC</constant> it will return only associative indices
while <constant>PGSQL_BOTH</constant>, the default, will return both
numerical and associative indices.
</para>
&pgsql.parameter.mode;
</listitem>
</varlistentry>
</variablelist>

View File

@@ -41,6 +41,12 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
&pgsql.parameter.mode;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

View File

@@ -34,18 +34,7 @@
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
An optional parameter that controls
how the returned <type>array</type> is indexed.
<parameter>mode</parameter> is a constant and can take the
following values: <constant>PGSQL_ASSOC</constant>,
<constant>PGSQL_NUM</constant> and <constant>PGSQL_BOTH</constant>.
Using <constant>PGSQL_NUM</constant>, <function>pg_get_notify</function>
will return an array with numerical indices, using
<constant>PGSQL_ASSOC</constant> it will return only associative indices
while <constant>PGSQL_BOTH</constant>, the default, will return both
numerical and associative indices.
</para>
&pgsql.parameter.mode;
</listitem>
</varlistentry>
</variablelist>