conni Wed Oct 8 16:07:30 2003 EDT
Modified files:
/phpdoc/en/reference/pgsql/functions pg-connection-status.xml
Log:
changed the example
Index: phpdoc/en/reference/pgsql/functions/pg-connection-status.xml
diff -u phpdoc/en/reference/pgsql/functions/pg-connection-status.xml:1.4
phpdoc/en/reference/pgsql/functions/pg-connection-status.xml:1.5
--- phpdoc/en/reference/pgsql/functions/pg-connection-status.xml:1.4 Wed Jul 16
05:20:01 2003
+++ phpdoc/en/reference/pgsql/functions/pg-connection-status.xml Wed Oct 8
16:07:29 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
<refentry id='function.pg-connection-status'>
<refnamediv>
@@ -15,9 +15,10 @@
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
- <function>pg_connection_status</function> returns a connection
- status. Possible statuses are <literal>PGSQL_CONNECTION_OK</literal>
- and <literal>PGSQL_CONNECTION_BAD</literal>.
+ <function>pg_connection_status</function> returns a connection status.
+ Possible statuses are <literal>PGSQL_CONNECTION_OK</literal> and
+ <literal>PGSQL_CONNECTION_BAD</literal>. The return value 0 as
+ integer indicates a valid connection.
</para>
<para>
<example>
@@ -27,7 +28,12 @@
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_connection_status($dbconn);
- echo 'connection_status: '.$stat;
+ if ($stat === 0) {
+ echo 'Connection status ok';
+ }
+ else {
+ echo 'Connection status bad';
+ }
?>
]]>
</programlisting>