diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-03-13 22:53:26 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-03-13 22:53:26 +0000 |
| commit | 93dcbe6ed9f99e2af8195e7ee85fcbd6ee0e247c (patch) | |
| tree | 37604e3e6d92b0773d969869fe892dbec305d617 /roundcubemail/program/include/rcube_db.inc | |
| parent | ce6713014beec6fb2645ad3d05add7a496b1bbae (diff) | |
Fixed bugs in rcube_db and rcube_imap classes
git-svn-id: https://svn.roundcube.net/trunk@504 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_db.inc')
| -rwxr-xr-x | roundcubemail/program/include/rcube_db.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/roundcubemail/program/include/rcube_db.inc b/roundcubemail/program/include/rcube_db.inc index a01b38dd6..f17605a74 100755 --- a/roundcubemail/program/include/rcube_db.inc +++ b/roundcubemail/program/include/rcube_db.inc @@ -293,14 +293,16 @@ class rcube_db { case 'pgsql': $result = &$this->db_handle->getOne("SELECT CURRVAL('$sequence')"); - - case 'mssql': - $result = &$this->db_handle->getOne("SELECT @@IDENTITY"); - if (DB::isError($result)) raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 'message' => $result->getMessage()), TRUE, FALSE); + return $result; + case 'mssql': + $result = &$this->db_handle->getOne("SELECT @@IDENTITY"); + if (DB::isError($result)) + raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, + 'message' => $result->getMessage()), TRUE, FALSE); return $result; case 'mysql': // This is unfortuneate @@ -308,7 +310,7 @@ class rcube_db case 'mysqli': return mysqli_insert_id($this->db_handle->connection); - + case 'sqlite': return sqlite_last_insert_rowid($this->db_handle->connection); @@ -358,7 +360,7 @@ class rcube_db */ function _fetch_row($result, $mode) { - if (DB::isError($result)) + if (!$result || DB::isError($result)) { raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 'message' => $this->db_link->getMessage()), TRUE, FALSE); |
