MINOR Better error debugging message when sqlsrv_errors() is used on MSSQLDatabase::query() on a failed query

This commit is contained in:
Sean Harvey 2010-06-03 12:03:27 +00:00
parent 78d47d312f
commit 13f90299cc

View File

@ -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']));
}
}
}
}