X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A0E28D1C4C1; Mon, 28 Jul 2003 00:55:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 47171-07; Sun, 27 Jul 2003 21:54:16 -0300 (ADT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by svr1.postgresql.org (Postfix) with ESMTP id 1AA12D1C4BB; Sun, 27 Jul 2003 21:55:04 -0300 (ADT) Received: from sys2 (12-232-24-239.client.attbi.com[12.232.24.239](untrusted sender)) by attbi.com (rwcrmhc11) with SMTP id <20030728005507013006s8b3e>; Mon, 28 Jul 2003 00:55:07 +0000 Reply-To: From: "bruce" To: , Subject: Accessing Postgres db from apache using PHP Date: Sun, 27 Jul 2003 18:00:14 -0700 Message-ID: <001501c354a3$9aee0b40$0301a8c0@Mesa.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/194 X-Sequence-Number: 7729 Hi... I'm new to Postgres... I've installed Postgres on a Linux RH 8.0 server. I'm trying to access a pgsql db from an Apache website, using PHP(v-4.2.2). I've taken a look at google and through the archives with no real luck... I created a Linux user and given the user rights to the Postgres group. I created a Linux user (gforge) and given it rights to the Postgres group. Using the gforge user, I created a postgres user, using -> createuser gforge - W I gave the user the password of ->gforge I gave the user rights to add/create databases, but not add new users I then installed a database. pgsql -U gforge -d gforge < gforge3.sql At this point, I can see that I have a db in postgres.... I did a "\l" and it displayed: name owner encoding -->> gforge gforge sql_ascii In my php code, I have.... $sys_dbhost = "localhost"; $sys_dbname = "gforge"; $sys_user = "gforge"; $sys_dbpasswd = "gforge"; i then do a: $tmp = "host=localhost dbname=gforge user=gforge password=gforge"; $conn = @pg_connect($tmp); at this point $conn is not set... it should be a resouce if I've connect to the DB..!!!!!!! So.. the question... Anybody have any idea as to what I've done wrong/left out/etc... Any pointers/comments/criticisms would be helpful..... Any sample docs, or code that illustrates how this should be accomplished would be helpful... Thanks... Bruce Douglas (925) 866-2790 bedouglas@earthlink.net