Вынес класс в отдельный файл
This commit is contained in:
parent
7187963ac9
commit
7bbccea3b0
5 changed files with 68 additions and 62 deletions
|
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue