summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Gorham <lurcher@php.net>1999-12-09 09:59:17 +0000
committerNick Gorham <lurcher@php.net>1999-12-09 09:59:17 +0000
commit25096ac9e93e7caac46ff4b22c4313b8b6b4c5ef (patch)
treed2596f69ba582781f56b3c1b1fae921482b8edbc
parentec7088e1df45a606aa5fe267af67a7b8789a095c (diff)
downloadphp-git-25096ac9e93e7caac46ff4b22c4313b8b6b4c5ef.tar.gz
Report all ODBC error's not just the top of the stack
-rw-r--r--NEWS1
-rw-r--r--ext/odbc/php_odbc.c21
2 files changed, 13 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index d5ee710f32..10413e51ec 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? ????, Version 4.0 Beta 4
+- Report all ODBC error's not just the one on the top of the stack (lurcher)
- OCI8 now returns NULL values in LONG columns correct. (Thies)
- Added support for a C-like assert() function. (Thies)
- Added CyberCash support. (Evan)
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 9a2d412809..5ab7bf915c 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -461,17 +461,20 @@ void ODBC_SQL_ERROR(HENV henv, HDBC conn, HSTMT stmt, char *func)
SDWORD error; /* Not used */
char errormsg[255];
SWORD errormsgsize; /* Not used */
+ SQLRETURN ret;
ODBCLS_FETCH();
-
- SQLError(henv, conn, stmt, state,
- &error, errormsg, sizeof(errormsg)-1, &errormsgsize);
- if (func) {
- php_error(E_WARNING, "SQL error: %s, SQL state %s in %s",
+
+ do {
+ SQLError(henv, conn, stmt, state,
+ &error, errormsg, sizeof(errormsg)-1, &errormsgsize);
+ if (func) {
+ php_error(E_WARNING, "SQL error: %s, SQL state %s in %s",
errormsg, state, func);
- } else {
- php_error(E_WARNING, "SQL error: %s, SQL state %s",
- errormsg, state);
- }
+ } else {
+ php_error(E_WARNING, "SQL error: %s, SQL state %s",
+ errormsg, state);
+ }
+ } while ( SQL_SUCCEEDED( ret ));
}
void php3_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)