diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-05 14:11:20 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-05 14:11:20 +0200 |
commit | c7db6bb9b64c8322af4d727bcb71122cd7f09dbf (patch) | |
tree | ce659c8b3051ce076b20eb7d4eb9026b9d3d582e /system/database/DB_result.php | |
parent | 34d67990c2987d662919f06bdf18d5cc522c2560 (diff) |
Clean-up the separate drivers' DB result classes from no longer needed methods
Diffstat (limited to 'system/database/DB_result.php')
-rw-r--r-- | system/database/DB_result.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/system/database/DB_result.php b/system/database/DB_result.php index fb3cff340..ee0b61201 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -68,9 +68,20 @@ class CI_DB_result { */ public function num_rows() { - return is_int($this->num_rows) - ? $this->num_rows - : $this->num_rows = 0; + if (is_int($this->num_rows)) + { + return $this->num_rows; + } + elseif (count($this->result_array) > 0) + { + return $this->num_rows = count($this->result_array); + } + elseif (count($this->result_object) > 0) + { + return $this->num_rows = count($this->result_object); + } + + return $this->num_rows = count($this->result_array()); } // -------------------------------------------------------------------- |