[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Postgres and php3 don't like each other



Shaleh hat gesagt: // Shaleh wrote:

> 
> On 21-Dec-98 Frank Barknecht wrote:
> > I am playing around with Postgresql and php3 and I cannot make a database
> > connection this way. The most simple script fails:
> > 
> > <?php   
> > $database = pg_Connect ("", "", "", "", "template");
> > ?> 
> > 
> 
> Pass user and password in the pg_connect function.  Look at www.php3.org's
> online docs for an example.

The docs just say:

[ http://www.php3.org/manual/html/function.pg-connect.html ]
A connection can also established with the following command: $conn = pg_connect("dbname=marliese port=5432");
Other parameters besides dbname and port are host, tty and options.

But I found the (not so good documented) solution with trial and error:
$database = pg_Connect ("dbname=template user=username");

Obviously user and password are also "other parameters".
-- 
                                                     __    __
 Frank Barknecht           ____ ______   ____ __ trip\ \  / /wire ______
                          / __// __  /__/ __// // __  \ \/ /  __ \\  ___\	
                         / /  / ____/  / /  / // ____// /\ \\  ___\\____ \	
                        /_/  /_____/  /_/  /_//_____// /  \ \\_____\\_____\
                                                    /_/    \_\ 


Reply to: