Skip to content

Commit

Permalink
Update MSSQLConnection.php
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Oct 28, 2024
1 parent d67e1d8 commit b7cda0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webfiori/database/mssql/MSSQLConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,17 @@ private function setSqlErr() {
$allErrs = sqlsrv_errors(SQLSRV_ERR_ERRORS);
$lastErr = $allErrs[count($allErrs) - 1];

if (strpos($lastErr['message'], 'The statement has been terminated') === false) {
if (strpos($lastErr['message'], 'The statement has been terminated') === true) {
$lastErr = $allErrs[count($allErrs) - 2];
$this->sqlState = $lastErr['SQLSTATE'];
$this->setErrMessage($lastErr['message']);
$this->setErrCode($lastErr['code']);
} else if (strpos($lastErr['message'], 'Statement(s) could not be prepared') === true) {
$lastErr = $allErrs[count($allErrs) - 1];
$this->sqlState = $lastErr['SQLSTATE'];
$this->setErrMessage('Statement(s) could not be prepared: '.$lastErr['message']);
$this->setErrCode($lastErr['code']);
} else {
$lastErr = $allErrs[count($allErrs) - 2];
$this->setErrCode($lastErr['code']);
$this->sqlState = $lastErr['SQLSTATE'];
$this->setErrMessage($lastErr['message']);
$this->setErrCode($lastErr['code']);
Expand Down

0 comments on commit b7cda0c

Please sign in to comment.