How to use Php connecting to pgsql

From: 马庆 <ma(dot)qing(at)staples(dot)sh(dot)cn>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to use Php connecting to pgsql
Date: 2006-12-30 03:32:12
Message-ID: 7567B1901217DD42933F932F3939A838254CAD@staples-mail2.staples.sh.cn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear All:
I come across a problem that I can't solve it, Can anyone help me, Thanks.
My configuration is RedHat AS4 + php5.0 + pgsql 8.1. When I finish install php, I install php_pgsql module in order to use php connecting pgsql. To my surprised , I can't get access to pgslq, there's nothing show on the page.
So I write <?php phpinfo() ?> it works.
I write <?php echo "hello world" ? $db = pg_connect(dbname=foo, user=foo,password=foo); if(!$db) print("error")?> , it doesn't work , only print "hello world" on the page.
But I use psql command with the same username and the same password, I can access to the pgsql.
Does anybody know how to solve it? Thanks
MARK

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ireneusz Pluta 2006-12-30 06:52:06 Re: How to use Php connecting to pgsql
Previous Message Michael Fuhr 2006-12-30 02:02:29 Re: psql script error handling