★ wanayoo — archive 1999 http://fr.php.net/manual/en/function.pg-host.phpNouvelle recherche | Portail wanayoo
PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<pg_get_resultpg_insert>
view the version of this page
Last updated: Sun, 12 Sep 2004

pg_host

(PHP 3, PHP 4 , PHP 5)

pg_host --  Returns the host name associated with the connection

Description

string pg_host ( resource connection)

pg_host() returns the host name of the given PostgreSQL connection resource is connected to.

See also pg_connect() and pg_pconnect().



add a note add a note User Contributed Notes
pg_host
mark at redbrick dot dcu dot ie
24-Mar-2003 03:21
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

<pg_get_resultpg_insert>
 Last updated: Sun, 12 Sep 2004
show source | credits | sitemap | contact | advertising | mirror sites 
Copyright © 2001-2004 The PHP Group
All rights reserved.
This mirror generously provided by: nexen.net
Last updated: Sat Sep 18 05:21:38 2004 CEST