failed connection to postgres - Mailing list pgsql-php

From SG Edwards
Subject failed connection to postgres
Date
Msg-id 1112283535.424c198f6f8ec@sms.ed.ac.uk
Whole thread Raw
Responses Re: failed connection to postgres  (Heather Johnson <hjohnson@nypost.com>)
Re: failed connection to postgres  (Frank Bax <fbax@sympatico.ca>)
List pgsql-php

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

pgsql-php by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Help needed to rewrite PHP PostgreSQL docs
Next
From: Heather Johnson
Date:
Subject: Re: failed connection to postgres