From 2b5440297c3754e9eb7d3f4a92c42aee843c531a Mon Sep 17 00:00:00 2001 From: Teo Date: Sun, 22 Jan 2012 21:36:56 +0100 Subject: [PATCH] added method to get last insert id --- MysqliDb.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MysqliDb.php b/MysqliDb.php index 30646925..ad991db5 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -221,6 +221,17 @@ public function where($whereProp, $whereValue) $this->_where[$whereProp] = $whereValue; return $this; } + + + /** + * This methods returns the ID of the last inserted item + * + * @return integer The last inserted item ID. + */ + public function getInsertId() + { + return $this->_mysqli->insert_id; + } /** * This method is needed for prepared statements. They require