Skip to content
Snippets Groups Projects
Commit ea6954b9 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #2681 fix pdo

parent d80d224a
No related branches found
No related tags found
No related merge requests found
...@@ -208,14 +208,14 @@ class Database extends functions ...@@ -208,14 +208,14 @@ class Database extends functions
switch($_SESSION['config']['databasetype']) { switch($_SESSION['config']['databasetype']) {
case 'MYSQL' : return @mysqli_insert_id($this->_sqlLink); case 'MYSQL' : return @mysqli_insert_id($this->_sqlLink);
case 'POSTGRESQL' : case 'POSTGRESQL' :
$this->query = @pg_query("select last_value as lastinsertid from " . $sequenceName); $stmt_last_insert = $this->query("SELECT last_value as lastinsertid FROM " . $sequenceName);
$line = @pg_fetch_object($this->query); $resultat_last = $stmt_last_insert->fetchObject();
return $line->lastinsertid; return $resultat_last->lastinsertid;
case 'SQLSERVER' : return ''; case 'SQLSERVER' : return '';
case 'ORACLE' : case 'ORACLE' :
$this->query("select " . $sequenceName . ".currval as lastinsertid from dual"); $stmt_last_insert = $this->query("SELECT " . $sequenceName . ".currval as lastinsertid FROM dual");
$line = $this->fetch_object($this->query); $resultat_last = $stmt_last_insert->fetchObject();
return $line->lastinsertid; return $resultat_last->lastinsertid;
default : return false; default : return false;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment