How to connect fron II5 to Postgres?
| From: | Mariusz Topczewski | Date: | Fri, 07 Jul 2000 07:18:43 +0000 |
| Subject: | How to connect fron II5 to Postgres? | ||
| Groups: | php.db php.windows | ||
| Request: | Send a blank email to php-windows+get-925@lists.php.net to get a copy of this message | ||
Hi,
I've problem with connect to PostgreSQL database. I created database 'test'
with table 'workers' and I've created user iusr_pzu79 with all rigrths to
table
below is output of command "\z":
template1=# \c test
You are now connected to database test.
test=# \z
Access permissions for database "test"
Relation | Access permissions
-----------------+-------------------------
workers | {"=","iusr_pzu79=arwR"}
workers_counter | {"=","iusr_pzu79=arwR"}
(2 rows)
Here is my index.php
<?
define("BASE_HOST", "localhost");
define("BASE_PORT", "5432");
define("BASE_NAME", "test");
echo "This is a test page!<BR>";
echo "I just have tried to connect to PostgreSQL database on Win2000
Proffesional with IIS 5.0 and PHP 4.0.1.pl2 with php_pgsql.dll
installed<BR>";
echo "<BR> below is the results:<br>";
echo $results=pg_connect(BASE_HOST, BASE_PORT, BASE_NAME);
echo pg_close("test");
echo "<BR>Bye...";
?>
Here is the result:
This is a test page!
I just have tried to connect to PostgreSQL database on Win2000 Proffesional
with IIS 5.0 and PHP 4.0.1.pl2 with php_pgsql.dll installed
below is the results:
Warning: Unable to connect to PostgresSQL server: FATAL 1: SetUserId: user
'IUSR_PZU79' is not in 'pg_shadow' in E:\home\mariuszt\test\index.php on
line 10
Warning: Supplied argument is not a valid PostgreSQL link resource in
E:\home\mariuszt\test\index.php on line 11
Bye...
Could anyone help me?
Regards,
Mariusz Topvczewski