mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
changed the example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@142069 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
2975fe3874
commit
f27a13f34b
1 changed files with 11 additions and 5 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue