note 30626 added to function.pg-host
| From: | mark at redbrick dot dcu dot ie | Date: | Mon, 24 Mar 2003 12:21:16 +0000 |
| Subject: | note 30626 added to function.pg-host | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45730@lists.php.net to get a copy of this message | ||
This is a simple example of this function, which returns the name of which PostreSQL Database you
are currently connected to.
<?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;
}
?>
This function is extremely useful for sites which connect to multiple Postgresql services.
Regards, --mark
--
http://www.php.net/manual/en/function.pg-host.php
http://master.php.net/manage/user-notes.php?action=edit+30626
http://master.php.net/manage/user-notes.php?action=delete+30626
http://master.php.net/manage/user-notes.php?action=reject+30626