summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2006-11-20 18:29:05 +0100
committerRick Ellis <rick.ellis@ellislab.com>2006-11-20 18:29:05 +0100
commit325197e700564f8e4e0ba7c9fc82abfd85f451b0 (patch)
treec109f0c96f187dc3b919aca591daf5767de4c982 /system/database/drivers/oci8
parentebfa686046bb98c757d1b41c81eb867478036e68 (diff)
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r--system/database/drivers/oci8/oci8_result.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php
index af30457b3..fb4ed1f0d 100644
--- a/system/database/drivers/oci8/oci8_result.php
+++ b/system/database/drivers/oci8/oci8_result.php
@@ -31,21 +31,24 @@ class CI_DB_oci8_result extends CI_DB_result {
var $limit_used;
/**
- * Number of rows in the result set
+ * Number of rows in the result set.
+ *
+ * Oracle doesn't have a graceful way to retun the number of rows
+ * so we have to use what amounts to a hack.
+ *
*
* @access public
* @return integer
*/
function num_rows()
{
- if (function_exists('oci_num_rows'))
- {
- return @oci_num_rows($this->stmt_id);
- }
- else
+ $rowcount = count($this->result_array());
+ @ociexecute($this->stmt_id);
+ if ($this->curs_id)
{
- return @ocirowcount($this->stmt_id);
+ @ociexecute($this->curs_id);
}
+ return $rowcount;
}
// --------------------------------------------------------------------
@@ -175,12 +178,7 @@ class CI_DB_oci8_result extends CI_DB_result {
{
$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;
- while ($row = oci_fetch_object($id))
- {
- $result[] = $row;
- }
-
- return $result;
+ return @oci_fetch_object($id);
}
// If PHP 4 is being used we have to build our own result