RE: [PHP-DB] Re: PostgreSQL error with PHP
| From: | Robbert van Andel | Date: | Mon, 27 Jun 2005 01:28:51 +0000 |
| Subject: | RE: [PHP-DB] Re: PostgreSQL error with PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39786@lists.php.net to get a copy of this message | ||
The error is in your function pg_connect
pg_connect("name=auth user=auth");
I'm not a PostgreSQL user but your connection string should be enclosed into
by quotes. Documentation can be found at
http://us3.php.net/manual/en/function.pg-connect.php
Hope this helps,
Robbert
-----Original Message-----
From: Thomas Bonham [mailto:thomasbbonham@gmail.com]
Sent: Sunday, June 26, 2005 5:43 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Re: PostgreSQL error with PHP
I modafide the code some more and now with the following code I get this
error.
CODE:
<html><head><title>Login</title>
</head>
<body>
<?php
pg_connect(name="auth"); (user="auth");
?>
</body>
</html>
Parse error: parse error, unexpected '=' in
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8
Thanks
Thomas Bonham wrote:
> Hello All,
> I'm trying to get php to connect to my PostgreSQL database.
> The code that I'm using is below.
>
>
> <html><head><title>Login</title>
>
> </head>
> <body>
> <?php
> $conn = "dbname=auth user=auth";
> $db = pg_connect ( $conn );
> ?>
> </body>
> </html>
>
> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL:
> IDENT authentication failed for user "auth" in
> /var/www/html/thomas/cis166ae/database/secretdb.php on line 8
>
> Below is how I set up my database.
>
> root@thomas # Su - postgres
>
> -bash-3.00$ createuser -D -A -E
> auth
> -bash-3.00$ createdb auth
>
> Thanks Helping
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php