mirror of
https://github.com/dg/dibi.git
synced 2025-02-23 18:33:45 +01:00
- implemented insertId() in MS SQL driver
This commit is contained in:
parent
9f8b19f1fb
commit
2f690b63f9
@ -133,7 +133,12 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
*/
|
||||
public function insertId($sequence)
|
||||
{
|
||||
throw new NotSupportedException('MS SQL does not support autoincrementing.');
|
||||
$res = mssql_query('SELECT @@IDENTITY', $this->connection);
|
||||
if (is_resource($res)) {
|
||||
$row = mssql_fetch_row($res);
|
||||
return $row[0];
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user