mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Using PDO method to get lastInsertId
This commit is contained in:
parent
a5f3f95e3a
commit
f772527445
1 changed files with 1 additions and 6 deletions
|
@ -313,12 +313,7 @@ class DboMysql extends DboSource {
|
|||
* @return in
|
||||
*/
|
||||
function lastInsertId($source = null) {
|
||||
$id = $this->fetchRow('SELECT LAST_INSERT_ID() AS insertID', false);
|
||||
if ($id !== false && !empty($id) && !empty($id[0]) && isset($id[0]['insertID'])) {
|
||||
return $id[0]['insertID'];
|
||||
}
|
||||
|
||||
return null;
|
||||
return $this->_connection->lastInsertId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue