Вынес класс в отдельный файл

This commit is contained in:
Фёдор Подлеснов 2018-01-30 15:31:18 +03:00
parent 7187963ac9
commit 7bbccea3b0
5 changed files with 68 additions and 62 deletions

View file

@ -126,7 +126,7 @@ class Database extends PDO
$sql = "INSERT INTO $table (" . implode(",", array_keys($values))
. ") VALUES (" . implode(",", array_keys($prep)). ")";
if($return_id){
if ($return_id) {
if ($this->isPostgres()){
$sql = $sql." RETURNING $index";
}
@ -139,7 +139,7 @@ class Database extends PDO
if ($this->isPostgres()) {
return $result[$index];
} else {
$result = $this->fetchOneArray("SELECT $index AS lastid FROM $table WHERE OID = last_insert_rowid()");
$result = $this->fetchOneArray("SELECT $index AS lastid FROM $table WHERE OID = last_insert_rowid()");
return $result['lastid'];
}
}