Skip to content

Commit 12e6984

Browse files
committed
Merge pull request #2 from teo-sk/patch-1
added method to get last insert id
2 parents 5019f88 + 2b54402 commit 12e6984

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

MysqliDb.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ public function where($whereProp, $whereValue)
221221
$this->_where[$whereProp] = $whereValue;
222222
return $this;
223223
}
224+
225+
226+
/**
227+
* This methods returns the ID of the last inserted item
228+
*
229+
* @return integer The last inserted item ID.
230+
*/
231+
public function getInsertId()
232+
{
233+
return $this->_mysqli->insert_id;
234+
}
224235

225236
/**
226237
* This method is needed for prepared statements. They require

0 commit comments

Comments
 (0)