re : making sql queries to postgresql
| From: | Christopher Smith | Date: | Mon, 11 Sep 2000 23:14:44 +0000 |
| Subject: | re : making sql queries to postgresql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2806@lists.php.net to get a copy of this message | ||
Hi Tan,
The problem is that the web server doesn't have access to the database. What you
need to do is "grant access" to the web server (usually running as wwwrun). If
you're not sure how to do this, send me an email. I've written a basic tutorial
that should help you out as well -
http://designmagick.50megs.com/postgresql-tutorial/
Chris.
------------------
Thought I was a little too brief. In addition to below, "test" is the name of
the database and "test2" is a table in this database, "firstname" is a field of
"test2".
Tan Chee Leong <tcheele2@yahoo.com> wrote:
Hi,
I'm a newbie trying to tie up php and postgresql. However, I'm meeting with
problems as follow:
dbase.php3
<?php
$link = pg_connect ("","","","","test")
or die ("Could not connect");
pg_exec($link, "select firstname "."from test2 ");
$message = pg_errormessage($link);
print ("Connected successfully");
print $message;
pg_close ($link);
?>
However, upon activation, the following was the message I received:
Warning: PostgresSQL query failed: ERROR: test2: Permission denied. in
/home/httpd/html/cheeleong/dbase.php3 on line 4
Connected successfullyERROR: test2: Permission denied.
Seems like I have no problem with connection but I am not allowed to do a query.
Appreciate your help. Thanks.
Cheers,
Chee Leong
This email message and any accompanying attachments may contain information that
is confidential and subject to legal privilege. If you are not the intended
recipient, do not read, use, disseminate, distribute or copy this message or
attachments. If you have received this message in error, please notify the
sender immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly, and with
authority, states them to be the views of AMP/GIO. Before opening any
attachments, please check them for viruses and defects.