mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-16 19:41:45 +02:00
added table and colum as parameter to Insert_ID() to correctly retrive the id under postgres and MaxDB
This commit is contained in:
@ -150,10 +150,12 @@ WHERE relkind = 'r' AND (c.relname='%s' or c.relname = lower('%s'))
|
||||
Using a OID as a unique identifier is not generally wise.
|
||||
Unless you are very careful, you might end up with a tuple having
|
||||
a different OID if a database must be reloaded. */
|
||||
function _insertid()
|
||||
function _insertid($table,$column)
|
||||
{
|
||||
if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false;
|
||||
return pg_getlastoid($this->_resultid);
|
||||
$oid = pg_getlastoid($this->_resultid);
|
||||
// to really return the id, we need the table and column-name, else we can only return the oid != id
|
||||
return empty($table) || empty($column) ? $oid : $this->GetOne("SELECT $column FROM $table WHERE oid=".(int)$oid);
|
||||
}
|
||||
|
||||
// I get this error with PHP before 4.0.6 - jlim
|
||||
|
Reference in New Issue
Block a user