summaryrefslogtreecommitdiffstats
path: root/codebase/db_sqlsrv.php
diff options
context:
space:
mode:
Diffstat (limited to 'codebase/db_sqlsrv.php')
-rw-r--r--codebase/db_sqlsrv.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/codebase/db_sqlsrv.php b/codebase/db_sqlsrv.php
index 597a74d..8242f8b 100644
--- a/codebase/db_sqlsrv.php
+++ b/codebase/db_sqlsrv.php
@@ -1,5 +1,10 @@
<?php
/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details
+*/
+?><?php
+/*
@author dhtmlx.com
@license GPL, see license.txt
*/
@@ -22,7 +27,7 @@ class SQLSrvDBDataWrapper extends DBDataWrapper{
$errors = sqlsrv_errors();
$message = Array();
foreach($errors as $error)
- $message[]=$error[$i]["SQLSTATE"].$error[$i]["code'"].$error[$i]["message"];
+ $message[]=$error["SQLSTATE"].$error["code'"].$error["message"];
throw new Exception("SQLSrv operation failed\n".implode("\n\n", $message));
}
@@ -39,9 +44,10 @@ class SQLSrvDBDataWrapper extends DBDataWrapper{
public function get_next($res){
$data = sqlsrv_fetch_array($res, SQLSRV_FETCH_ASSOC);
- foreach ($data as $key => $value)
- if (is_a($value, "DateTime"))
- $data[$key] = $value->format("Y-m-d H:i");
+ if ($data)
+ foreach ($data as $key => $value)
+ if (is_a($value, "DateTime"))
+ $data[$key] = $value->format("Y-m-d H:i");
return $data;
}