PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

pg_insert> <pg_get_result
Last updated: Fri, 26 Dec 2008

view this page in

pg_Host

(PHP 4, PHP 5)

pg_HostDevuelve el nombre del host

Descripción

string pg_host ( int $connection_id )

pg_Host() devuelve el nombre del host al que identificador conexión PostgreSQL pasado está conectado.



add a note add a note User Contributed Notes
pg_Host
mark at redbrick dot dcu dot ie
24-Mar-2003 02: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_insert> <pg_get_result
Last updated: Fri, 26 Dec 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites