cvs: php4 /ext/dbx dbx_odbc.c
| From: | Marc Boeren | Date: | Thu, 19 Jul 2001 15:45:56 +0000 |
| Subject: | cvs: php4 /ext/dbx dbx_odbc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6271@lists.php.net to get a copy of this message | ||
mboeren Thu Jul 19 11:45:56 2001 EDT
Modified files:
/php4/ext/dbx dbx_odbc.c
Log:
Added the error-message functionality (new in odbc module) (Mc)
Index: php4/ext/dbx/dbx_odbc.c
diff -u php4/ext/dbx/dbx_odbc.c:1.9 php4/ext/dbx/dbx_odbc.c:1.10
--- php4/ext/dbx/dbx_odbc.c:1.9 Wed Jun 20 07:30:47 2001
+++ php4/ext/dbx/dbx_odbc.c Thu Jul 19 11:45:56 2001
@@ -246,8 +246,19 @@
}
int dbx_odbc_error(zval ** rv, zval ** dbx_handle, INTERNAL_FUNCTION_PARAMETERS) {
- /* returns empty string, no equivalent in odbc module (yet???) */
- ZVAL_EMPTY_STRING((*rv));
+ /* returns string */
+ int number_of_arguments=1;
+ zval ** arguments[1];
+ zval * returned_zval=NULL;
+
+ arguments[0]=dbx_handle;
+ if (!dbx_handle) number_of_arguments=0;
+ dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_errormsg",
&returned_zval, number_of_arguments, arguments);
+ if (!returned_zval || returned_zval->type!=IS_STRING) {
+ if (returned_zval) zval_ptr_dtor(&returned_zval);
+ return 0;
+ }
+ MOVE_RETURNED_TO_RV(rv, returned_zval);
return 1;
}