|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-22 08:32 UTC] thorsten at rinne dot info
[2003-10-22 19:49 UTC] kalowsky@php.net
[2003-10-27 02:28 UTC] thorsten at rinne dot info
[2003-10-31 09:35 UTC] kalowsky@php.net
[2003-11-03 02:29 UTC] thorsten at rinne dot info
[2004-09-16 15:18 UTC] vrana@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 21:00:01 2025 UTC |
Description: ------------ We use IBM DB2 databases on our Windows2000 systems. The bug occured then writing a database class. The odbc_error() function returns sometimes bad strings with special characters. If a real error occurs, the function returns the correct six-digit ODBC state. After that, the error code will not be removed from memory and the error code will be returned on every query although it is correct. Note: var_dump(odbc_error()) returns sometimes bad strings with special characters, sometimes nothing. Reproduce code: --------------- function myquery($query) { $result = odbc_exec($conn, $query); if (odbc_error($conn)) { print "SQLQuery: ".$query; print "ErrorNum: ".odbc_error($conn)); print "ErrorMsg: ".odbc_errormsg($conn)); } return $result; } Expected result: ---------------- The expected result should be empty when no error occured and the six-digit ODBC state when an error occured. After every correct new query, the result should be empty. Actual result: -------------- Here are some results, the queries are correct: SQLQuery: SELECT * FROM SYSTEM ErrorNum: 8??P? ErrorMsg: ?x?? or SQLQuery: SELECT * FROM SYSTEM2 ErrorNum: ?WPW ErrorMsg: or SQLQuery: SELECT * FROM SYSTEM ErrorNum: ErrorMsg: