From edx@intrinsec.com Fri Oct 15 10:06:43 1999 Received: from troie.INTRINsec.com ([194.98.42.3]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA17548 for ; Fri, 15 Oct 1999 06:06:43 -0400 (EDT) (envelope-from edx@intrinsec.com) Received: from sync.intrinsec.com (sync.INTRINsec.com [194.98.42.5]) by troie.INTRINsec.com (8.9.3/8.9.3) with ESMTP id MAA04346 for ; Fri, 15 Oct 1999 12:07:35 +0100 (GMT+0100) Received: from dooz.corp.intrinsec.com (root@dooz.corp.INTRINsec.com [10.100.1.12]) by sync.intrinsec.com (8.8.8/8.8.8) with SMTP id MAA18488 for ; Fri, 15 Oct 1999 12:08:19 +0200 (CEST) From: Edouard DESSIOUX Organization: INTRINsec To: pgsql-interfaces@postgresql.org Subject: Using php and postgres Date: Thu, 14 Oct 1999 12:08:24 +0200 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <9910141208580I.00504@dooz.corp.intrinsec.com> Content-Transfer-Encoding: 8bit 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: 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 Warning: 0 is not a PostgresSQL link index in /www/dooz.corp.intrinsec.com/mail/essai.php3 on line 4 Postmaster is started, and in psql, i can read : manip=> FATAL 1: Database www does not exist in pg_database Anyone know what i done wrong ? -- Edouard DESSIOUX Proverbe chien : "Si ca se mange pas, Si ca se baise pas, Pisse dessus !!" From z.nijmeyers@cable.a2000.nl Fri Oct 15 11:28:08 1999 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'