Added a getLastInsertedID method

This commit is contained in:
Pierre 2017-06-10 14:49:51 +02:00
parent 1d70e373f3
commit 6498132ef2

View File

@ -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
*