summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-07 14:44:00 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-07 14:44:00 +0100
commit92f62b03812c6079fc5e73d865d727627e533e63 (patch)
treeab0ad0916b3cd2c7bf5eca2e33a853ba2e920a68 /system/database/drivers/pdo
parentc1ee5a02e6bac4547e5b52e1dba4d39285fafe87 (diff)
Manually apply an improved version of PR #2427
Diffstat (limited to 'system/database/drivers/pdo')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 1ecc90a82..d153af2e7 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -190,14 +190,12 @@ class CI_DB_pdo_driver extends CI_DB {
{
$sql = $this->_prep_query($sql);
$result_id = $this->conn_id->prepare($sql);
- $result_id->execute();
-
- if (is_object($result_id))
+
+ if (is_object($result_id) && ($result = $result_id->execute()))
{
if (is_numeric(stripos($sql, 'SELECT')))
{
$this->affect_rows = count($result_id->fetchAll());
- $result_id->execute();
}
else
{
@@ -207,9 +205,10 @@ class CI_DB_pdo_driver extends CI_DB {
else
{
$this->affect_rows = 0;
+ $result = FALSE;
}
-
- return $result_id;
+
+ return $result;
}
// --------------------------------------------------------------------