diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php
index 947a761..efb2f7b 100644
--- a/system/database/drivers/oci8/oci8_result.php
+++ b/system/database/drivers/oci8/oci8_result.php
@@ -38,18 +38,14 @@
 	 */
 	function num_rows()
 	{
-		// get the results, count them,
-		// rerun query - otherwise we
-		// won't have data after calling
-		// num_rows()
-		$this->result_array();
-		$rowcount = count($this->result_array);
-		@ociexecute($this->stmt_id);
-		if ($this->curs_id)
+		if (function_exists('oci_num_rows'))
 		{
-			@ociexecute($this->curs_id);
+			return @oci_num_rows($this->stmt_id);
 		}
-		return $rowcount;
+		else
+		{
+			return @ocirowcount($this->stmt_id)
+		}
 	}
 
 	// --------------------------------------------------------------------