pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Bax <fbax@sympatico.ca>
To: pgsql-php@postgresql.org
Subject: Re: failed connection to postgres
Date: Thu, 31 Mar 2005 14:56:52 -0500
Message-ID: <5.2.1.1.0.20050331145111.05828bf0@pop6.sympatico.ca> (raw)
In-Reply-To: <1112283535.424c198f6f8ec@sms.ed.ac.uk>

At 10:38 AM 3/31/05, SG Edwards wrote:

>If I use the following code to connect to postgres using PHP:
>
><?php
>echo "trying to connect to the database...";
>
>$conn =pg_connect("host=localhost dbname=milker dbuser=s0460205
>dbpass=password");
>
>if (!$conn) {
>echo "no connection";
>}
>?>
>
>However, the connection is not made. If I try to run it from the command 
>line in
>UNIX I get the following error:
>
>PHP warning: pg_connect(): Unable to connect to PostgreSQL server: invalid
>connection option &quot;dbuser&quot; in 
>/home/s0460205/public_html/first.php on
>line 12
>
>The username, database name and password are definately right and my 
>database is
>on the same server as the script (thus I assume localhost for host?) so should
>this not work?



READ THE ERROR MESSAGE!!  It's telling you that 'dbuser' is not a valid 
connection option - you won't find 'dbuser' mentioned anywhere on the man 
page (perhaps you should read it more carefully too):
         http://www.php.net/manual/en/function.pg-connect.php




view thread (3+ messages)

Message-ID: <5.2.1.1.0.20050331145111.05828bf0@pop6.sympatico.ca>
Permalink:  ../5.2.1.1.0.20050331145111.05828bf0@pop6.sympatico.ca/
Also on:    postgresql.org/message-id/5.2.1.1.0.20050331145111.05828bf0@pop6.sympatico.ca

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: fbax@sympatico.ca
  Subject: Re: failed connection to postgres
  In-Reply-To: <5.2.1.1.0.20050331145111.05828bf0@pop6.sympatico.ca>
  References: <1112283535.424c198f6f8ec@sms.ed.ac.uk> <5.2.1.1.0.20050331145111.05828bf0@pop6.sympatico.ca>

* 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