note 59308 added to function.pg-last-error
| From: | Pino at osu1 dot php dot net | Date: | Fri, 02 Dec 2005 17:24:38 +0000 |
| Subject: | note 59308 added to function.pg-last-error | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99460@lists.php.net to get a copy of this message | ||
The example in this page:
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
print "Successfully connected to: " . pg_host($pgsql_conn) . "<br/>\n";
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>
is not a good one, because pg_last_error will fail if $pgsql_conn, or the current connection,
doesn't exists.
pg_last_error can be used after any other function, but not after pg_connect
----
Manual Page -- http://www.php.net/manual/en/function.pg-last-error.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59308
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59308&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59308&report=yes
Search -- http://master.php.net/manage/user-notes.php