mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Implementing lastInsertId for postgres
This commit is contained in:
parent
5c87daf083
commit
ab9c8904ad
1 changed files with 1 additions and 2 deletions
|
@ -294,8 +294,7 @@ class DboPostgres extends DboSource {
|
|||
*/
|
||||
function lastInsertId($source, $field = 'id') {
|
||||
$seq = $this->getSequence($source, $field);
|
||||
$data = $this->fetchRow("SELECT currval('{$seq}') as max");
|
||||
return $data[0]['max'];
|
||||
return $this->_connection->lastInsertId($seq);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue