diff options
| author | Damien Regad <dregad@mantisbt.org> | 2018-03-30 19:29:59 +0200 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2018-03-30 19:29:59 +0200 |
| commit | 4011379abe34845d44612dbe904f435b6cd81d9f (patch) | |
| tree | e4c2e8a086ce635ad267c202fcb9a38b01dc2649 /drivers/adodb-odbc.inc.php | |
| parent | 0f82a576c73172fcab8e9f03a5dedfc6fb9a01ec (diff) | |
| parent | 1377bc3f9ae50d935da2ff83784a6ff5640cba68 (diff) | |
| download | adodb-4011379abe34845d44612dbe904f435b6cd81d9f.tar.gz adodb-4011379abe34845d44612dbe904f435b6cd81d9f.tar.bz2 adodb-4011379abe34845d44612dbe904f435b6cd81d9f.zip | |
Merge branch 'hotfix/5.20'
Conflicts:
adodb.inc.php
docs/changelog.md
Diffstat (limited to 'drivers/adodb-odbc.inc.php')
| -rw-r--r-- | drivers/adodb-odbc.inc.php | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/adodb-odbc.inc.php b/drivers/adodb-odbc.inc.php index 52b26307..8101dae5 100644 --- a/drivers/adodb-odbc.inc.php +++ b/drivers/adodb-odbc.inc.php @@ -76,11 +76,10 @@ class ADODB_odbc extends ADOConnection { $argDSN .= 'Database='.$argDatabasename; } - error_clear_last(); + $last_php_error = $this->resetLastError(); if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword); else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode); - $err = error_get_last(); - $this->_errorMsg = $err ? $err['message'] : ''; + $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); if (isset($this->connectStmt)) $this->Execute($this->connectStmt); return $this->_connectionID != false; @@ -89,10 +88,10 @@ class ADODB_odbc extends ADOConnection { // returns true or false function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) { - if (!function_exists('odbc_connect')) return null; - error_clear_last(); + $last_php_error = $this->resetLastError(); + $this->_errorMsg = ''; if ($this->debug && $argDatabasename) { ADOConnection::outp("For odbc PConnect(), $argDatabasename is not used. Place dsn in 1st parameter."); } @@ -100,8 +99,7 @@ class ADODB_odbc extends ADOConnection { if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword); else $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode); - $err = error_get_last(); - $this->_errorMsg = $err ? $err['message'] : ''; + $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID); if (isset($this->connectStmt)) $this->Execute($this->connectStmt); @@ -527,8 +525,8 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od /* returns queryID or false */ function _query($sql,$inputarr=false) { - error_clear_last(); - $this->_error = ''; + $last_php_error = $this->resetLastError(); + $this->_errorMsg = ''; if ($inputarr) { if (is_array($sql)) { @@ -537,8 +535,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od $stmtid = odbc_prepare($this->_connectionID,$sql); if ($stmtid == false) { - $err = error_get_last(); - $this->_errorMsg = $err ? $err['message'] : ''; + $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); return false; } } @@ -580,16 +577,14 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od $this->_errorMsg = ''; $this->_errorCode = 0; } else { - $err = error_get_last(); - $this->_errorMsg = $err ? $err['message'] : ''; + $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); } } else { if ($this->_haserrorfunctions) { $this->_errorMsg = odbc_errormsg(); $this->_errorCode = odbc_error(); } else { - $err = error_get_last(); - $this->_errorMsg = $err ? $err['message'] : ''; + $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); } } return $stmtid; |
