From a37fd93c379c6c1b47a99afbd1f0eeca359e4213 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 5 Mar 2010 02:40:20 +0000 Subject: [PATCH] BUGFIX Stop sqlsrv warnings from being returned as errors to keep it in line with mssql functions --- code/MSSQLDatabase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index 90846eb..c2ffec1 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -83,6 +83,11 @@ class MSSQLDatabase extends SS_Database { if($this->mssql) { $this->dbConn = mssql_connect($parameters['server'], $parameters['username'], $parameters['password'], true); } else { + // Disable default warnings as errors behaviour for sqlsrv to keep it in line with mssql functions + if(ini_get('sqlsrv.WarningsReturnAsErrors')) { + ini_set('sqlsrv.WarningsReturnAsErrors', 'Off'); + } + // Windows authentication doesn't require a username and password if(defined('MSSQL_USE_WINDOWS_AUTHENTICATION') && MSSQL_USE_WINDOWS_AUTHENTICATION == true) { $connectionInfo = array();