summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorSimon Holywell <[email protected]>2016-12-14 14:22:01 +1000
committerGitHub <[email protected]>2016-12-14 14:22:01 +1000
commitbd4bc89304f0cc72e6447b7581f2bb2f090106a9 (patch)
tree670276406309dc1dc8eeb0d6c53964b33c50e22b /idiorm.php
parent391eb8aa27b107a79286e3c21f5f30580f20ae5e (diff)
parent2ff8cd553598ae6fd0f516696489b4552068255d (diff)
Merge pull request #235 from lrlopez/compound_key_fix
Fix autoincremented compound keys inserts
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/idiorm.php b/idiorm.php
index 080ef5d..7125a33 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -2101,7 +2101,7 @@
// if the primary key is compound, assign the last inserted id
// to the first column
if (is_array($column)) {
- $column = array_slice($column, 0, 1);
+ $column = reset($column);
}
$this->_data[$column] = $db->lastInsertId();
}