diff options
author | alecpl <alec@alec.pl> | 2009-07-20 11:12:33 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-07-20 11:12:33 +0000 |
commit | 6955c70f286dee3d003736c911ad9d3203b0be6c (patch) | |
tree | 9d6ad796744e5fc2ba95f79f5a5ed951ffc04fbf | |
parent | 93af155f6434bf5b057cf1018ba76c6b2a9ab0e9 (diff) |
- handle errors in insert_id()
-rw-r--r-- | program/include/rcube_mdb2.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index a83b463b4..86d798a79 100644 --- a/program/include/rcube_mdb2.php +++ b/program/include/rcube_mdb2.php @@ -330,7 +330,9 @@ class rcube_mdb2 if (!$this->db_handle || $this->db_mode=='r') return FALSE; - return $this->db_handle->lastInsertID($sequence); + $id = $this->db_handle->lastInsertID($sequence); + + return $this->db_handle->isError($id) ? null : $id; } |