diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/odbc/php_odbc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 2aeebdf32c..0adcc7cad8 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1457,8 +1457,13 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) if (result_type & ODBC_NUM) { zend_hash_index_update(Z_ARRVAL_P(return_value), i, &tmp, sizeof(pval *), NULL); } else { - zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, + if (!*(result->values[i].name)) { + zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(tmp), + Z_STRLEN_P(tmp)+1, &tmp, sizeof(pval *), NULL); + } else { + zend_hash_update(Z_ARRVAL_P(return_value), result->values[i].name, strlen(result->values[i].name)+1, &tmp, sizeof(pval *), NULL); + } } } if (buf) efree(buf); |