summaryrefslogtreecommitdiff
path: root/ext/mssql/php_mssql.c
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2000-11-29 17:08:22 +0000
committerFrank M. Kromann <fmk@php.net>2000-11-29 17:08:22 +0000
commit5cb6b6c667ba8df282a0e82b3c5f84bf12bd4d98 (patch)
tree0c3e0ab9b79e37c3ae6e7f6a205c39b07885b83c /ext/mssql/php_mssql.c
parentf7650fe8aea2c74dd71bee665453b533d1fb484f (diff)
downloadphp-git-5cb6b6c667ba8df282a0e82b3c5f84bf12bd4d98.tar.gz
Fixing wring resource handle returned from mssql_query().
The error was introduced when adding mssql_fetch_batch().
Diffstat (limited to 'ext/mssql/php_mssql.c')
-rw-r--r--ext/mssql/php_mssql.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 10bde67f04..617a80a552 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -899,12 +899,12 @@ PHP_FUNCTION(mssql_query)
RETURN_FALSE;
}
- result = (mssql_result *) emalloc(sizeof(mssql_result));
num_fields = dbnumcols(mssql_ptr->link);
if (num_fields <= 0) {
- RETURN_TRUE;
+ RETURN_FALSE;
}
+ result = (mssql_result *) emalloc(sizeof(mssql_result));
column_types = (int *) emalloc(sizeof(int) * num_fields);
for (i=0; i<num_fields; i++) {
column_types[i] = coltype(i+1);
@@ -961,7 +961,6 @@ PHP_FUNCTION(mssql_query)
}
efree(column_types);
ZEND_REGISTER_RESOURCE(return_value, result, le_result);
- RETURN_TRUE;
}
/* }}} */