pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gravity <z.nijmeyers@cable.a2000.nl>
To: Edouard DESSIOUX <edx@intrinsec.com>
To: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Using php and postgres
Date: Fri, 15 Oct 1999 13:33:13 +0200
Message-ID: <4.1.19991015132916.00a76da0@mail.a2000.nl> (raw)
In-Reply-To: <9910141208580I.00504@dooz.corp.intrinsec.com>

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:
> <?php $database = pg_connect ("dbname=manip port=5432"); ?> 


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'





view thread (2+ messages)

Message-ID: <4.1.19991015132916.00a76da0@mail.a2000.nl>
Permalink:  ../4.1.19991015132916.00a76da0@mail.a2000.nl/
Also on:    postgresql.org/message-id/4.1.19991015132916.00a76da0@mail.a2000.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: z.nijmeyers@cable.a2000.nl, edx@intrinsec.com
  Subject: Re: [INTERFACES] Using php and postgres
  In-Reply-To: <4.1.19991015132916.00a76da0@mail.a2000.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox