summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/pdo_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-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;
}
// --------------------------------------------------------------------