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.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 1ecc90a82..e0e7dab65 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -5,7 +5,7 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
- * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
+ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @author EllisLab Dev Team
* @link http://codeigniter.com
@@ -36,7 +36,7 @@ class CI_DB_pdo_driver extends CI_DB {
var $_escape_char = '';
var $_like_escape_str;
var $_like_escape_chr;
-
+
/**
* The syntax to count rows is slightly different across different
@@ -45,7 +45,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
var $_count_string = "SELECT COUNT(*) AS ";
var $_random_keyword;
-
+
var $options = array();
function __construct($params)
@@ -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;
}
// --------------------------------------------------------------------