|
16 | 16 | </methodsynopsis>
|
17 | 17 | <para>
|
18 | 18 | <function>pg_pconnect</function> opens a connection to a
|
19 |
| - PostgreSQL database. It returns an <classname>PgSql\Connection</classname> instance that is |
| 19 | + PostgreSQL database. It returns a <classname>PgSql\Connection</classname> instance that is |
20 | 20 | needed by other PostgreSQL functions.
|
21 | 21 | </para>
|
22 | 22 | <para>
|
|
27 | 27 | <parameter>flags</parameter>.
|
28 | 28 | </para>
|
29 | 29 | <para>
|
30 |
| - To enable persistent connection, the <link linkend="ini.pgsql.allow-persistent">pgsql.allow_persistent</link> |
31 |
| - &php.ini; directive must be set to "On" (which is the default). |
32 |
| - The maximum number of persistent connection can be defined with the <link linkend="ini.pgsql.max-persistent">pgsql.max_persistent</link> |
33 |
| - &php.ini; directive (defaults to -1 for no limit). The total number |
34 |
| - of connections can be set with the <link linkend="ini.pgsql.max-links">pgsql.max_links</link> |
| 30 | + To enable persistent connections, the <link linkend="ini.pgsql.allow-persistent">pgsql.allow_persistent</link> |
| 31 | + &php.ini; directive must be set to <literal>"On"</literal> (which is the default). |
| 32 | + The maximum number of persistent connections can be defined with the <link linkend="ini.pgsql.max-persistent">pgsql.max_persistent</link> |
| 33 | + &php.ini; directive (defaults to <literal>-1</literal> for no limit). The total number |
| 34 | + of connections can be set with the <link linkend="ini.pgsql.max-links">pgsql.max_links</link> |
35 | 35 | &php.ini; directive.
|
36 | 36 | </para>
|
37 | 37 | <para>
|
|
54 | 54 | the equal sign are optional. To write an empty value or a value
|
55 | 55 | containing spaces, surround it with single quotes, e.g., <literal>keyword =
|
56 | 56 | 'a value'</literal>. Single quotes and backslashes within the value must be
|
57 |
| - escaped with a backslash, i.e., \' and \\. |
| 57 | + escaped with a backslash, i.e., <literal>\'</literal> and <literal>\\</literal>. |
58 | 58 | </para>
|
59 | 59 | <para>
|
60 | 60 | The currently recognized parameter keywords are:
|
|
63 | 63 | <parameter>password</parameter>, <parameter>connect_timeout</parameter>,
|
64 | 64 | <parameter>options</parameter>, <parameter>tty</parameter> (ignored), <parameter>sslmode</parameter>,
|
65 | 65 | <parameter>requiressl</parameter> (deprecated in favor of <parameter>sslmode</parameter>), and
|
66 |
| - <parameter>service</parameter>. Which of these arguments exist depends |
| 66 | + <parameter>service</parameter>. Which of these arguments exist depends |
67 | 67 | on your PostgreSQL version.
|
68 | 68 | </para>
|
69 | 69 | </listitem>
|
|
85 | 85 | <refsect1 role="returnvalues">
|
86 | 86 | &reftitle.returnvalues;
|
87 | 87 | <para>
|
88 |
| - Returns an <classname>PgSql\Connection</classname> instance on success, &return.falseforfailure;. |
| 88 | + Returns a <classname>PgSql\Connection</classname> instance on success, &return.falseforfailure;. |
89 | 89 | </para>
|
90 | 90 | </refsect1>
|
91 | 91 |
|
|
103 | 103 | <row>
|
104 | 104 | <entry>8.1.0</entry>
|
105 | 105 | <entry>
|
106 |
| - Returns an <classname>PgSql\Connection</classname> instance now; |
| 106 | + Returns a <classname>PgSql\Connection</classname> instance now; |
107 | 107 | previously, a &resource; was returned.
|
108 | 108 | </entry>
|
109 | 109 | </row>
|
|
120 | 120 | <programlisting role="php">
|
121 | 121 | <![CDATA[
|
122 | 122 | <?php
|
| 123 | +// Connect to a database named "mary" |
123 | 124 | $dbconn = pg_pconnect("dbname=mary");
|
124 |
| -//connect to a database named "mary" |
125 | 125 |
|
| 126 | +// Connect to a database named "mary" on "localhost" at port "5432" |
126 | 127 | $dbconn2 = pg_pconnect("host=localhost port=5432 dbname=mary");
|
127 |
| -// connect to a database named "mary" on "localhost" at port "5432" |
128 | 128 |
|
| 129 | +// Connect to a database named "mary" on the host "sheep" with a username and password |
129 | 130 | $dbconn3 = pg_pconnect("host=sheep port=5432 dbname=mary user=lamb password=foo");
|
130 |
| -//connect to a database named "mary" on the host "sheep" with a username and password |
131 | 131 |
|
| 132 | +// Connect to a database named "test" on the host "sheep" with a username and password |
132 | 133 | $conn_string = "host=sheep port=5432 dbname=test user=lamb password=bar";
|
133 | 134 | $dbconn4 = pg_pconnect($conn_string);
|
134 |
| -//connect to a database named "test" on the host "sheep" with a username and password |
135 | 135 | ?>
|
136 | 136 | ]]>
|
137 | 137 | </programlisting>
|
|
0 commit comments