Clean-up the separate drivers' DB result classes from no longer needed methods
diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php
index 0085ef6..1d998be 100644
--- a/system/database/drivers/odbc/odbc_result.php
+++ b/system/database/drivers/odbc/odbc_result.php
@@ -48,14 +48,22 @@
{
return $this->num_rows;
}
-
- // Work-around for ODBC subdrivers that don't support num_rows()
- if (($this->num_rows = @odbc_num_rows($this->result_id)) === -1)
+ elseif (($this->num_rows = @odbc_num_rows($this->result_id)) !== -1)
{
- $this->num_rows = count($this->result_array());
+ return $this->num_rows;
}
- return $this->num_rows;
+ // Work-around for ODBC subdrivers that don't support num_rows()
+ if (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());
}
// --------------------------------------------------------------------
@@ -164,76 +172,6 @@
return odbc_fetch_object($this->result_id);
}
- // --------------------------------------------------------------------
-
- /**
- * Query result. Array version.
- *
- * @return array
- */
- public function result_array()
- {
- if (count($this->result_array) > 0)
- {
- return $this->result_array;
- }
- elseif (($c = count($this->result_object)) > 0)
- {
- for ($i = 0; $i < $c; $i++)
- {
- $this->result_array[$i] = (array) $this->result_object[$i];
- }
- }
- elseif ($this->result_id === FALSE)
- {
- return array();
- }
- else
- {
- while ($row = $this->_fetch_assoc())
- {
- $this->result_array[] = $row;
- }
- }
-
- return $this->result_array;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Query result. Object version.
- *
- * @return array
- */
- public function result_object()
- {
- if (count($this->result_object) > 0)
- {
- return $this->result_object;
- }
- elseif (($c = count($this->result_array)) > 0)
- {
- for ($i = 0; $i < $c; $i++)
- {
- $this->result_object[$i] = (object) $this->result_array[$i];
- }
- }
- elseif ($this->result_id === FALSE)
- {
- return array();
- }
- else
- {
- while ($row = $this->_fetch_object())
- {
- $this->result_object[] = $row;
- }
- }
-
- return $this->result_object;
- }
-
}
// --------------------------------------------------------------------