conn.php 488 Bytes
Newer Older
reynaldi adriantama's avatar
reynaldi adriantama committed
1 2 3 4 5 6 7 8 9
<?php

    $host     = getenv('ITB_HOST');
    $username = getenv('ITB_UNAME');
    $password = getenv('ITB_PASS');
    $dbname   = getenv('ITB_SCH');
    $port     = getenv('ITB_PORT');

    $connection = pg_connect ("host='$host' dbname='$dbname' options='-c search_path=sde,public' user='$username' password='$password' port='$port'");
reynaldi adriantama's avatar
reynaldi adriantama committed
10
    // print_r($dbname);die;
reynaldi adriantama's avatar
reynaldi adriantama committed
11 12 13 14 15 16
    if($connection) {
       echo 'connected';
    } else {
        echo 'there has been an error connecting';
    }
?>