From 965874ccaed0c4f97570ed458a34825e148163fe Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 19 Jun 2006 01:08:52 +0000 Subject: [PATCH] Merging fix from 1.1.x.x branch [3132] Adding patch from Ticket #1004. This fixed problem with table prefix not being used when querying for the last record id git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3133 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/model_php4.php | 2 +- cake/libs/model/model_php5.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/model_php4.php b/cake/libs/model/model_php4.php index 56c154c6c..67e4da5cf 100644 --- a/cake/libs/model/model_php4.php +++ b/cake/libs/model/model_php4.php @@ -862,7 +862,7 @@ class Model extends Object{ } } else { if ($db->create($this, $fields, $values)) { - $this->__insertID = $db->lastInsertId($this->table, $this->primaryKey); + $this->__insertID = $db->lastInsertId($this->tablePrefix . $this->table, $this->primaryKey); if (!$this->__insertID && $newID != null) { $this->__insertID = $newID; diff --git a/cake/libs/model/model_php5.php b/cake/libs/model/model_php5.php index b60e9f36f..ca4236e47 100644 --- a/cake/libs/model/model_php5.php +++ b/cake/libs/model/model_php5.php @@ -859,7 +859,7 @@ class Model extends Object{ } } else { if ($db->create($this, $fields, $values)) { - $this->__insertID = $db->lastInsertId($this->table, $this->primaryKey); + $this->__insertID = $db->lastInsertId($this->tablePrefix . $this->table, $this->primaryKey); if (!$this->__insertID && $newID != null) { $this->__insertID = $newID;