diff --git a/lib/database/dbutil.inc b/lib/database/dbutil.inc index cbece5a..b6a42f8 100644 --- a/lib/database/dbutil.inc +++ b/lib/database/dbutil.inc @@ -168,7 +168,7 @@ class DBUtil { if ($bNoId) return; else - return mysql_insert_id(); + return $db->getLastId(); } if (PEAR::isError($res)) { DBUtil::logQueryError(DBUtil::lastQuery($db), $res); diff --git a/thirdparty/pear/DB/common.php b/thirdparty/pear/DB/common.php index 868a101..c33d337 100644 --- a/thirdparty/pear/DB/common.php +++ b/thirdparty/pear/DB/common.php @@ -2030,6 +2030,22 @@ class DB_common extends PEAR } // }}} + + // {{{ getLastId() + + /** + * Returns the last insert ID + * + * @return int + * + * @access public + */ + function getLastId() + { + return $this->_getLastId(); + } + + // }}} } /* diff --git a/thirdparty/pear/DB/mysql.php b/thirdparty/pear/DB/mysql.php index 481b453..e3bc951 100644 --- a/thirdparty/pear/DB/mysql.php +++ b/thirdparty/pear/DB/mysql.php @@ -904,6 +904,22 @@ class DB_mysql extends DB_common // }}} + // {{{ _getLastId() + + /** + * Returns the last insert ID + * + * @return int + * + * @access private + */ + function _getLastId() + { + return mysql_insert_id($this->connection); + } + + // }}} + } /*