From 2ff8cd553598ae6fd0f516696489b4552068255d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Ram=C3=B3n=20L=C3=B3pez?= Date: Sat, 20 Sep 2014 20:13:42 +0200 Subject: Fix autoincremented compound keys inserts When inserting new records on a autoincremented compound keys table, a bug would prevent updating the autoincremented value. Fixes #233 --- idiorm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'idiorm.php') diff --git a/idiorm.php b/idiorm.php index 0e305fd..39eaabd 100644 --- a/idiorm.php +++ b/idiorm.php @@ -2027,7 +2027,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(); } -- cgit v1.2.3