ibase_result *ib_result;
XSQLVAR *var;
- RESET_ERRMSG;
-
switch (ZEND_NUM_ARGS()) {
case 1:
if (ZEND_NUM_ARGS() == 1 && zend_get_parameters_ex(1, &result_arg) == FAILURE) {
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, "InterBase result", le_result);
- if (ib_result->out_sqlda == NULL) {
- _php_ibase_module_error("Trying to fetch results from a non-select query");
+ if (ib_result->out_sqlda == NULL || !ib_result->has_more_rows) {
RETURN_FALSE;
- }
-
- if (!ib_result->has_more_rows) {
- RETURN_FALSE;
- }
+ } /* might have been because of an error */
+
+ RESET_ERRMSG;
array_init(return_value);