From: SG Edwards <s0460205@sms.ed.ac.uk>
To: pgsql-php@postgresql.org
Subject: failed connection to postgres
Date: Thu, 31 Mar 2005 16:38:55 +0100
Message-ID: <1112283535.424c198f6f8ec@sms.ed.ac.uk> (raw)
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 "dbuser" 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?
Many thanks for your help
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: s0460205@sms.ed.ac.uk
Subject: Re: failed connection to postgres
In-Reply-To: <1112283535.424c198f6f8ec@sms.ed.ac.uk>
References: <1112283535.424c198f6f8ec@sms.ed.ac.uk>
* 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