diff options
author | Stanislav <stanislau.wolski@gmail.com> | 2011-08-15 14:23:08 +0300 |
---|---|---|
committer | Stanislav <stanislau.wolski@gmail.com> | 2011-08-15 14:23:08 +0300 |
commit | c83f0293bc6f67ceb4c141c9051683302e1f9d12 (patch) | |
tree | ea87e059d6eb109898e68cf627bd79a463fcaaaa /codebase | |
parent | 7c7d7acbd74b19acd1fa77856ba7f25049b7fbdb (diff) | |
download | connector-php-c83f0293bc6f67ceb4c141c9051683302e1f9d12.zip connector-php-c83f0293bc6f67ceb4c141c9051683302e1f9d12.tar.gz connector-php-c83f0293bc6f67ceb4c141c9051683302e1f9d12.tar.bz2 |
[feature] Error logging for sqlsrv db driver
Diffstat (limited to 'codebase')
-rw-r--r-- | codebase/db_sqlsrv.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/codebase/db_sqlsrv.php b/codebase/db_sqlsrv.php index 1dfd4ef..c0f9299 100644 --- a/codebase/db_sqlsrv.php +++ b/codebase/db_sqlsrv.php @@ -18,6 +18,13 @@ class SQLSrvDBDataWrapper extends DBDataWrapper{ else $res = sqlsrv_query($this->connection,$sql); + if ($res === false){ + $errors = sqlsrv_errors(); + $message = Array(); + foreach($errors as $error) + $message[]=$error[$i]["SQLSTATE"].$error[$i]["code'"].$error[$i]["message"]; + throw new Exception("SQLSrv operation failed\n".implode("\n\n", $message)); + } if ($this->insert_operation){ sqlsrv_next_result($res); |