note 68580 added to function.pg-connection-status
| From: | MathieuDeZutter at osu1 dot php dot net | Date: | Wed, 02 Aug 2006 12:45:40 +0000 |
| Subject: | note 68580 added to function.pg-connection-status | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115461@lists.php.net to get a copy of this message | ||
Being careful with the comparison operators is not enough:
<?php
if (pg_connection_status($link)===PGSQL_CONNECTION_BAD)
reconnect($link);
?>
The reconnect won't be trigged when $link is null.
The manual is just wrong, there are three return values: PGSQL_CONNECTION_OK, PGSQL_CONNECTION_BAD,
null
----
Server IP: 216.194.113.175
Probable Submitter: 15.203.169.125
----
X-Spam-Status: No, hits=3.8 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
UPPERCASE_25_50 autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.pg-connection-status.php
Edit -- https://master.php.net/note/edit/68580
Del: integrated -- https://master.php.net/note/delete/68580/integrated
Del: useless -- https://master.php.net/note/delete/68580/useless
Del: bad code -- https://master.php.net/note/delete/68580/bad+code
Del: spam -- https://master.php.net/note/delete/68580/spam
Del: non-english -- https://master.php.net/note/delete/68580/non-english
Del: in docs -- https://master.php.net/note/delete/68580/in+docs
Del: other reasons-- https://master.php.net/note/delete/68580
Reject -- https://master.php.net/note/reject/68580
Search -- https://master.php.net/manage/user-notes.php