Received: from smtp1.a2000.nl (farida.a2000.nl [62.108.1.19]) by hub.org (8.9.3/8.9.3) with ESMTP id HAA28781 for ; Fri, 15 Oct 1999 07:28:08 -0400 (EDT) (envelope-from z.nijmeyers@cable.a2000.nl) Received: from node10065.a2000.nl ([24.132.0.101] helo=node10066) by smtp1.a2000.nl with smtp (Exim 2.02 #4) id 11c5Wm-0001Ji-00; Fri, 15 Oct 1999 13:28:04 +0200 Message-Id: <4.1.19991015132916.00a76da0@mail.a2000.nl> X-Sender: znijmeye@mail.a2000.nl X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Fri, 15 Oct 1999 13:33:13 +0200 To: Edouard DESSIOUX , pgsql-interfaces@postgresql.org From: gravity Subject: Re: [INTERFACES] Using php and postgres In-Reply-To: <9910141208580I.00504@dooz.corp.intrinsec.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 12:08 14-10-99 +0200, Edouard DESSIOUX wrote: > > Hello, > I'm using apache postgres and php, > I created a database called "manip" > and i want to acces this database via a web page > > I use the following php script to connect to the base: > use pg_connect ("dbname=manip user=USERNAME password=PASSWORD port=5432") > > And i obtain : > Warning: Unable to connect to PostgresSQL server: FATAL 1: Database www does > not exist in pg_database in > /www/dooz.corp.intrinsec.com/mail/essai.php3 on line 3 if you don't declare user then the connection will be made with the user running php/apache: in this case 'www'. the connection fails because the username is not correct and I guess pg then tries to connect you to your own database, named after the user: 'www'