From: Dirk Becker <becker@adocom.de>
To: pgsql-php@postgresql.org
Subject: cant conect to dynamic host-URL
Date: Wed, 01 Nov 2006 19:36:36 +0100
Message-ID: <4548E934.5090904@adocom.de> (raw)
Hi there, ive got a dynamic URL like myname.dyndns.org which links to my
server
where my postgres database runs. The Problem is that the Connection
fails with error:
"Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown
host name: adocom.dyndns.org"
Now, if i ping my dynamic address and use the resulting IP for the
Connection all works fine.
I dont know where my i did something wrong, i use an Java-Applet which
connects also with the dynamic Address and works fine too. :(
Here is my php-Code i use:
// Option-class which holds some information
class Option {
var $host = "myname.dyndns.org"; // Adresse des DBMS-Servers
var $port = "5432"; // Port auf dem
das DBMS laeuft
var $dbname = "Database"; // Name der Datenbank
var $user = "postgres"; // DBMS Benutzer
var $passwd = "secret"; // DBMS Passwort
}
// Connection in index.php
$conn = pg_connect("host=".$OptObj->host." port=".$OptObj->port."
dbname=".$OptObj->dbname." user=".$OptObj->user."
password=".$OptObj->passwd);
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: becker@adocom.de
Subject: Re: cant conect to dynamic host-URL
In-Reply-To: <4548E934.5090904@adocom.de>
References: <4548E934.5090904@adocom.de>
* 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