From: foobar Date: Fri, 29 Jun 2001 03:12:06 +0000 (+0000) Subject: Fixed bug: #11728. Error message was cleared before outputted in pg_pconnect() X-Git-Tag: PRE_TSRM_MERGE_PATCH~311 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc3482d65f23df7de4ae1dc289a52dbf05d40c90;p=php Fixed bug: #11728. Error message was cleared before outputted in pg_pconnect() --- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index c1bb10e486..fd959d560d 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -434,10 +434,10 @@ void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) pgsql=PQsetdb(host,port,options,tty,dbname); } if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { + php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql)); if (pgsql) { PQfinish(pgsql); } - php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql)); efree(hashed_details); RETURN_FALSE; }