diff options
-rw-r--r-- | ext/pgsql/pgsql.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index f65a80dee9..947fd2a009 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -940,7 +940,8 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (PQgetisnull(pgsql_result, Z_LVAL_PP(row), i)) { if (result_type & PGSQL_NUM) { add_index_unset(return_value, i); - } else { + } + if (result_type & PGSQL_ASSOC) { field_name = PQfname(pgsql_result, i); add_assoc_unset(return_value, field_name); } |