summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Newnham <mark@newnhams.com>2018-07-20 17:36:37 -0600
committerGitHub <noreply@github.com>2018-07-20 17:36:37 -0600
commitf4b96b0d62762138305624bb09f5dffd3b1e7f3d (patch)
tree1133d0299d22ea14e2990cd6df128e38278ca692
parente167895234555119b8122f331b54aad4680ad246 (diff)
downloadadodb-f4b96b0d62762138305624bb09f5dffd3b1e7f3d.tar.gz
adodb-f4b96b0d62762138305624bb09f5dffd3b1e7f3d.tar.bz2
adodb-f4b96b0d62762138305624bb09f5dffd3b1e7f3d.zip
Insert_ID Returns null when table name in square brackets see #313
If the commonly used method of enclosing table name is square brackets is used, insert_id() fails due to a problem with regexp
-rw-r--r--drivers/adodb-mssqlnative.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php
index 0143aa99..d43e0434 100644
--- a/drivers/adodb-mssqlnative.inc.php
+++ b/drivers/adodb-mssqlnative.inc.php
@@ -569,7 +569,7 @@ class ADODB_mssqlnative extends ADOConnection {
$insert = false;
// handle native driver flaw for retrieving the last insert ID
- if(preg_match('/^\W*insert[\s\w()",.]+values\s*\((?:[^;\']|\'\'|(?:(?:\'\')*\'[^\']+\'(?:\'\')*))*;?$/i', $sql)) {
+ if(preg_match('/^\W*insert[\s\w()[\]",.]+values\s*\((?:[^;\']|\'\'|(?:(?:\'\')*\'[^\']+\'(?:\'\')*))*;?$/i', $sql)) {
$insert = true;
$sql .= '; '.$this->identitySQL; // select scope_identity()
}