php-doc-en/reference/pgsql/functions/pg-connection-status.xml
Mehdi Achour ca777ca163 CS
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@142103 c90b9560-bf6c-de11-be94-00142212c4b1
2003-10-09 10:08:56 +00:00

66 lines
1.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
<refentry id='function.pg-connection-status'>
<refnamediv>
<refname>pg_connection_status</refname>
<refpurpose>
Get connection status
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>pg_connection_status</methodname>
<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>. The return value 0 as
integer indicates a valid connection.
</para>
<para>
<example>
<title><function>pg_connection_status</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_connection_status($dbconn);
if ($stat === 0) {
echo 'Connection status ok';
} else {
echo 'Connection status bad';
}
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>pg_connection_busy</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->