mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Fix resultID check
This commit is contained in:
parent
e184cd7f09
commit
a050c89a66
@ -2454,7 +2454,7 @@ class BaseBuilder
|
||||
|
||||
$result = $this->db->query($sql, $this->binds, false);
|
||||
|
||||
if ($result->resultID)
|
||||
if ($result->resultID !== false)
|
||||
{
|
||||
// Clear our binds so we don't eat up memory
|
||||
$this->binds = [];
|
||||
|
@ -558,7 +558,7 @@ class Model
|
||||
|
||||
if ($response instanceof BaseResult)
|
||||
{
|
||||
$response = $response->resultID;
|
||||
$response = $response->resultID !== false;
|
||||
}
|
||||
elseif ($response !== false)
|
||||
{
|
||||
|
@ -471,7 +471,7 @@ class ModelTest extends CIDatabaseTestCase
|
||||
$this->seeInDatabase('job', ['name' => 'Developer']);
|
||||
|
||||
$result = $model->delete(1);
|
||||
$this->assertTrue($result->resultID);
|
||||
$this->assertTrue($result->resultID !== false);
|
||||
|
||||
$this->dontSeeInDatabase('job', ['name' => 'Developer']);
|
||||
}
|
||||
@ -1529,7 +1529,7 @@ class ModelTest extends CIDatabaseTestCase
|
||||
$result = $model->protect(false)
|
||||
->insert($data, false);
|
||||
|
||||
$this->assertTrue($result->resultID);
|
||||
$this->assertTrue($result->resultID !== false);
|
||||
|
||||
$lastInsertId = $model->getInsertID();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user