mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
MINOR Better error debugging message when sqlsrv_errors() is used on MSSQLDatabase::query() on a failed query
This commit is contained in:
parent
78d47d312f
commit
13f90299cc
@ -254,7 +254,13 @@ class MSSQLDatabase extends SS_Database {
|
||||
$handle = sqlsrv_query($this->dbConn, $sql);
|
||||
if($handle) $this->lastAffectedRows = sqlsrv_rows_affected($handle);
|
||||
if(function_exists('sqlsrv_errors')) {
|
||||
$error = sqlsrv_errors();
|
||||
$errInfo = sqlsrv_errors();
|
||||
$error = '';
|
||||
if($errInfo) {
|
||||
foreach($errInfo as $info) {
|
||||
$error .= implode(', ', array($info['SQLSTATE'], $info['code'], $info['message']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user