note 59308 deleted from function.pg-last-error by betz
| From: | betz@php.net | Date: | Fri, 02 Dec 2005 17:57:00 +0000 |
| Subject: | note 59308 deleted from function.pg-last-error by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-99467@lists.php.net to get a copy of this message | ||
Note Submitter: Pino
Reason: already in docs
----
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