Connect to database using pg_connect

From: <Gene(dot)Brumm(at)thomson(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Connect to database using pg_connect
Date: 2005-03-29 16:09:25
Message-ID: D7E3DC215167A3479A7B771C33BC0EBE06ED666A@tlrusmneagmbx01.erf.thomson.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm trying to connect to a database using the following. When I execute
this code, I see the "Before pg_connect ..." but nothing else. What am I
doing wrong?

<html>

<head>

<title>PHP Test</title>

</head>

<body>

<?php

echo 'Before pg_connect ...';

$hDB = @pg_connect("dbname=TestDB user=geneb password=dynamo!");

echo 'Before if ...';

if(! is_resource($hDB)) {

throw new Exception('Unable to connect to the database.');

}

echo 'Got here ...';

?>

</body>

</html>

Browse pgsql-novice by date

  From Date Subject
Next Message John DeSoi 2005-03-29 18:40:39 Re: Calling Stored Procedures from PHP
Previous Message Tom Lane 2005-03-29 15:34:13 Re: cannot makedb