Re: connecting via php

From: "K Parker" <kparker(at)eudoramail(dot)com>
To: pgsql-general(at)hub(dot)org
Subject: Re: connecting via php
Date: 2000-09-11 15:00:10
Message-ID: KNDCMHEEGMLNAAAA@shared1-mail.whowhere.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> $connection = pg_connect("localhost",
"113", "testjordi");

Why would you assume 113 is the port? But you shouldn't need to use TCP/IP anyway if you're connecting to the local machine (and TCP/IP connections aren't even available unless you start postmaster with the '-i' flag.)

I've never had any problem using the simplest style of unix-domain connection by saying (as shown in the first row of the how-to-connect table on the pg manual page of php):

if (! ($conn = pg_pconnect("","","","","webdata")))
{
$failure_msg = "Can't connect\n";
}
else
// you're in like flynn.

Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com

Browse pgsql-general by date

  From Date Subject
Next Message Mike Sears 2000-09-11 15:07:53 Re: PostgreSQL + PHP can't connect
Previous Message Tom Lane 2000-09-11 14:47:20 Re: count(*) from view??