diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-06-11 15:16:35 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-06-11 15:16:35 +0200 |
commit | 686ff126762c0923556036a3cf73abb9390a7e67 (patch) | |
tree | c0aedf7f9ce68ed3e5880f9f1ba14ddf03eb7083 /system/database/drivers/pdo/pdo_result.php | |
parent | 918eaef728eaf49387083b39add7106e029fcfb4 (diff) | |
parent | cef5bda9765080b818898811023d9ab427b0faf2 (diff) |
Fixed conflicts
Why were there conflicts merging into master?
Diffstat (limited to 'system/database/drivers/pdo/pdo_result.php')
-rw-r--r-- | system/database/drivers/pdo/pdo_result.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index 7c4a2f977..650b5f98d 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -34,7 +34,18 @@ class CI_DB_pdo_result extends CI_DB_result { */ function num_rows() { - return $this->result_id->rowCount(); + if (is_numeric(stripos($this->result_id->queryString, 'SELECT'))) + { + $dbh = $this->conn_id; + $query = $dbh->query($this->result_id->queryString); + $result = $query->fetchAll(); + unset($dbh, $query); + return count($result); + } + else + { + return $this->result_id->rowCount(); + } } // -------------------------------------------------------------------- |