diff --git a/classes/DBLibrary.php b/classes/DBLibrary.php index a0ea86a..0f7c54a 100755 --- a/classes/DBLibrary.php +++ b/classes/DBLibrary.php @@ -311,6 +311,25 @@ class DBLibrary { return $return; } + /** + * Get the last inserted ID of a cursor + * + * @param Nothing + * @return Integer The last inserted ID (0 for a failure) + */ + public function getLastInsertedID(){ + try { + //Get & return last inserted ID + return $this->db->lastInsertId(); + } + catch(Exception $e){ + exit($this->echoException($e)); + } + catch(PDOException $e){ + exit($this->echoPDOException($e)); + } + } + /** * Get datas from a table *