PostgreSQL connection problem #2

From: Date: Sun, 18 Nov 2001 17:29:53 +0000
Subject: PostgreSQL connection problem #2
Groups: php.db 
Request: Send a blank email to php-db+get-14425@lists.php.net to get a copy of this message
Hi, I could solve part of the problem by creating a user and database called 'www-data'. The new question is how can I connect to an arbitrary database? (This seems to be a configuration problem for me.) Since I have more sites on the same server, I really need more db-s. My previous letter was: I try to connect to a PostgreSQL database from my php script, and I get the following error: Warning: Unable to connect to PostgreSQL server: FATAL 1: Database "www-data" does not exist in the system catalog. in /home/lao/proj/hajnalcsillag/www/classes/DBConnection.php on line 10 The code is: <? class DBConnection { var $con_string; function DBConnection() { $con_string = "dbname=hajnalcsillag user=lao password=abc123 host=localhost port=5432"; $ret = pg_connect( $this->con_string ); } } ?> The versions are: PHP Version 4.1.0RC1 PostgreSQL 7.1.3 Apache/1.3.22 Debian sid Could anyone help me please? Thanks, Peter

« previous php.db (#14425) next »