Aleksander Machniak
2012-08-08 ea08d4c9617b2ffd36a53d3759e102a3c52ef69b
Improve is_error() so we can check for state of specified query
1 files modified
12 ■■■■ changed files
program/include/rcube_db.php 12 ●●●● patch | view | raw | blame | history
program/include/rcube_db.php
@@ -266,11 +266,17 @@
    /**
     * Getter for error state
     *
     * @return boolean True on error
     * @param int $res_id Optional query result identifier
     *
     * @return boolean True on error, False otherwise
     */
    public function is_error()
    public function is_error($res_id = null)
    {
        return $this->db_error ? $this->db_error_msg : false;
        if ($res_id !== null) {
            return $this->_get_result($res_id) === false;
        }
        return $this->db_error;
    }
    /**