pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feednewbie question about PHP
2+ messages / 2 participants
[nested] [flat]
* newbie question about PHP
@ 1998-06-24 04:22 Steve Doliov <doliov@statsol.com>
0 siblings, 0 replies; 2+ messages in thread
From: Steve Doliov @ 1998-06-24 04:22 UTC (permalink / raw)
To: pgsql-novice@postgresql.org; +Cc: pgsql-interfaces
i am trying to connect to a database using webpages with embedded php3.0
postmaster is running with the -i option
the database is running with the -u option
the web user is nobody, and user nobody has select privileges on
the given database.
from the shell, i can access the database as user nobody
$ psql -u mydatabase
Username: nobody
Password: xxxx
mydatabase=>
---------------
<?PHP
$conn = pg_Connect("localhost", "5432", "user=nobody,password=demo",
"", "grocery");
if (!$conn) {
echo "An error occurred.\n";
exit;
}
....
?>
this is what resulting page says:
Warning: Unable to connect to PostgresSQL server: User authentication
failed in
/home1/s/statsol/public_html/test/test.phtml on line 21
An error occurred.
my user=,password= is obviously a hack, i am just looking for how to
specify it for the pgoptions part of the pg_connect; help with the
syntax would be much appreciated.
thanks,
steve doliov
^ permalink raw reply [nested|flat] 2+ messages in thread
* RE: [INTERFACES] newbie question about PHP
@ 1998-06-24 15:25 Jackson, DeJuan <djackson@cpsgroup.com>
0 siblings, 0 replies; 2+ messages in thread
From: Jackson, DeJuan @ 1998-06-24 15:25 UTC (permalink / raw)
To: Steve Doliov <doliov@statsol.com>; pgsql-novice@postgreSQL.org; +Cc: pgsql-interfaces
try:
pg_Connect("host=localhost user=$username password=$password port=5432
dbname=SomeDatabase") //[Note the lack of commas.]
-DEJ
> -----Original Message-----
> From: Steve Doliov [SMTP:doliov@statsol.com]
> Sent: Tuesday, June 23, 1998 11:22 PM
> To: pgsql-novice@postgreSQL.org
> Cc: pgsql-interfaces@postgreSQL.org
> Subject: [INTERFACES] newbie question about PHP
>
> i am trying to connect to a database using webpages with embedded
> php3.0
>
> postmaster is running with the -i option
> the database is running with the -u option
> the web user is nobody, and user nobody has select privileges on
> the given database.
> from the shell, i can access the database as user nobody
> $ psql -u mydatabase
> Username: nobody
> Password: xxxx
> mydatabase=>
> ---------------
> <?PHP
> $conn = pg_Connect("localhost", "5432", "user=nobody,password=demo",
> "", "grocery");
> if (!$conn) {
> echo "An error occurred.\n";
> exit;
> }
> ....
> ?>
>
> this is what resulting page says:
>
> Warning: Unable to connect to PostgresSQL server: User authentication
> failed in
> /home1/s/statsol/public_html/test/test.phtml on line 21
> An error occurred.
>
> my user=,password= is obviously a hack, i am just looking for how to
> specify it for the pgoptions part of the pg_connect; help with the
> syntax would be much appreciated.
>
> thanks,
> steve doliov
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-06-24 15:25 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-06-24 04:22 newbie question about PHP Steve Doliov <doliov@statsol.com>
1998-06-24 15:25 RE: [INTERFACES] newbie question about PHP Jackson, DeJuan <djackson@cpsgroup.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox