summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 19f9fe4eb0..b9bee9676a 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -951,14 +951,15 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC)
SQLUSMALLINT colfieldid;
int charextraalloc;
- colfieldid = SQL_COLUMN_DISPLAY_SIZE;
- charextraalloc = 0;
result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0);
result->longreadlen = ODBCG(defaultlrl);
result->binmode = ODBCG(defaultbinmode);
for(i = 0; i < result->numcols; i++) {
+ charextraalloc = 0;
+ colfieldid = SQL_COLUMN_DISPLAY_SIZE;
+
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME,
result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE,