Received: from bjke.com (firewall-user@ganymede.bjke.com [144.210.8.38]) by hub.org (8.8.8/8.7.5) with ESMTP id LAA21876; Wed, 24 Jun 1998 11:26:37 -0400 (EDT) Received: by bjke.com; id LAA07694; Wed, 24 Jun 1998 11:26:36 -0400 (EDT) Received: from cpsmail.cpsgroup.com(144.210.12.11) by gauntlet.bjke.com via smap (3.2) id xmaa06655; Wed, 24 Jun 98 11:25:27 -0400 Received: by cpsmail with Internet Mail Service (5.0.1458.49) id ; Wed, 24 Jun 1998 10:25:48 -0500 Message-ID: From: "Jackson, DeJuan" To: Steve Doliov , pgsql-novice@postgreSQL.org Cc: pgsql-interfaces@postgreSQL.org Subject: RE: [INTERFACES] newbie question about PHP Date: Wed, 24 Jun 1998 10:25:46 -0500 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain try: pg_Connect("host=localhost user=$username password=$password port=5432 dbname=SomeDatabase") //[Note the lack of commas.] -DEJ > -----Original Message----- > From: Steve Doliov [SMTP:doliov@statsol.com] > Sent: Tuesday, June 23, 1998 11:22 PM > To: pgsql-novice@postgreSQL.org > Cc: pgsql-interfaces@postgreSQL.org > Subject: [INTERFACES] newbie question about PHP > > i am trying to connect to a database using webpages with embedded > php3.0 > > postmaster is running with the -i option > the database is running with the -u option > the web user is nobody, and user nobody has select privileges on > the given database. > from the shell, i can access the database as user nobody > $ psql -u mydatabase > Username: nobody > Password: xxxx > mydatabase=> > --------------- > $conn = pg_Connect("localhost", "5432", "user=nobody,password=demo", > "", "grocery"); > if (!$conn) { > echo "An error occurred.\n"; > exit; > } > .... > ?> > > this is what resulting page says: > > Warning: Unable to connect to PostgresSQL server: User authentication > failed in > /home1/s/statsol/public_html/test/test.phtml on line 21 > An error occurred. > > my user=,password= is obviously a hack, i am just looking for how to > specify it for the pgoptions part of the pg_connect; help with the > syntax would be much appreciated. > > thanks, > steve doliov