mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 23:57:29 +02:00
MS SQL PDO: Display last insert ID
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
- PostgreSQL 11: Support PROCEDURE
|
- PostgreSQL 11: Support PROCEDURE
|
||||||
- SQLite PDO: Display results in SQL query
|
- SQLite PDO: Display results in SQL query
|
||||||
- MS SQL: Fix collation issues when retrieving default values
|
- MS SQL: Fix collation issues when retrieving default values
|
||||||
|
- MS SQL PDO: Display last insert ID
|
||||||
- CSS: Sticky table headers (bug #918)
|
- CSS: Sticky table headers (bug #918)
|
||||||
- CSS: Allow more custom styles with dark mode (bug #925)
|
- CSS: Allow more custom styles with dark mode (bug #925)
|
||||||
- CSS: Increase maximum width of string edit (bug #930)
|
- CSS: Increase maximum width of string edit (bug #930)
|
||||||
|
@@ -156,12 +156,25 @@ if (isset($_GET["mssql"])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function last_id($result) {
|
||||||
|
return get_val("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
class MssqlDb extends PdoDb {
|
class MssqlDb extends PdoDb {
|
||||||
function select_db($database) {
|
function select_db($database) {
|
||||||
// database selection is separated from the connection so dbname in DSN can't be used
|
// database selection is separated from the connection so dbname in DSN can't be used
|
||||||
return $this->query(use_sql($database));
|
return $this->query(use_sql($database));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lastInsertId() {
|
||||||
|
return $this->pdo->lastInsertId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function last_id($result) {
|
||||||
|
global $connection;
|
||||||
|
return $connection->lastInsertId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extension_loaded("pdo_sqlsrv")) {
|
if (extension_loaded("pdo_sqlsrv")) {
|
||||||
@@ -543,10 +556,6 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
function last_id($result) {
|
|
||||||
return get_val("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
|
|
||||||
}
|
|
||||||
|
|
||||||
function explain($connection, $query) {
|
function explain($connection, $query) {
|
||||||
$connection->query("SET SHOWPLAN_ALL ON");
|
$connection->query("SET SHOWPLAN_ALL ON");
|
||||||
$return = $connection->query($query);
|
$return = $connection->query($query);
|
||||||
|
Reference in New Issue
Block a user