Search Postgresql Archives

Re: php password authentication failed for user ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 9, 2014 at 5:04 AM, basti <mailinglist@xxxxxxxxxxxxxxxx> wrote:
> Hello my pg_hab.conf has this entry:
>
> host    all             all             127.0.0.1/32            md5
>
> When I try to use PHP to connect to the Database I get
>
> "postgres password authentication failed for user ..."
>
> The PHP-code looks like
>
>
> global $dbhost, $dbuser, $dbpass, $dbname, $use_pgsql, $dbconn;
>
> if ($use_pgsql)
> {
>         $connect = "host=$dbhost user=$dbuser password=$dbpass
> dbname=$dbname";
>                 echo $connect;
>         if (!($dbconn = pg_connect($connect)))
>         {
>                 open_page();
>                 ErrSQL("Unable to connect to database.");
>         }


This is not proper error handling. Use the pg_* functions that report
the actual error, not some string you made on your own.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux