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
This commit is contained in:
phpnut 2006-06-19 01:08:52 +00:00
parent dfb49aad38
commit 965874ccae
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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;