mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +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') {
|
function lastInsertId($source, $field = 'id') {
|
||||||
$seq = $this->getSequence($source, $field);
|
$seq = $this->getSequence($source, $field);
|
||||||
$data = $this->fetchRow("SELECT currval('{$seq}') as max");
|
return $this->_connection->lastInsertId($seq);
|
||||||
return $data[0]['max'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue