From 7d42eb39484a784496868f4446a2d47b0c52410d Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 17 Feb 2012 14:21:18 -0500 Subject: More general fix for num_rows --- .../drivers/interbase/interbase_driver.php | 53 ---------------------- .../drivers/interbase/interbase_result.php | 5 +- 2 files changed, 4 insertions(+), 54 deletions(-) (limited to 'system/database/drivers/interbase') diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php index 7bd4f6f4b..20663d8bb 100644 --- a/system/database/drivers/interbase/interbase_driver.php +++ b/system/database/drivers/interbase/interbase_driver.php @@ -624,59 +624,6 @@ SQL; { @ibase_close($conn_id); } - - // -------------------------------------------------------------------------- - - /** - * Returns an array of table names - * - * @access public - * @return array - */ - function list_tables($constrain_by_prefix = FALSE) - { - // Is there a cached result? - if (isset($this->data_cache['table_names'])) - { - return $this->data_cache['table_names']; - } - - if (FALSE === ($sql = $this->_list_tables($constrain_by_prefix))) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - $retval = array(); - $query = $this->query($sql); - - $table = FALSE; - $rows = $query->result_array(); - - // This has to be called after getting the result due to the - // limitations of the database driver - if ($query->num_rows() > 0) - { - $key = (($row = current($rows)) && in_array('table_name', array_map('strtolower', array_keys($row)))); - - if ($key) - { - $table = array_key_exists('TABLE_NAME', $row) ? 'TABLE_NAME' : 'table_name'; - } - - foreach ($rows as $row) - { - $retval[] = ( ! $table) ? current($row) : $row[$table]; - } - } - - $this->data_cache['table_names'] = $retval; - - return $this->data_cache['table_names']; - } } /* End of file interbase_driver.php */ diff --git a/system/database/drivers/interbase/interbase_result.php b/system/database/drivers/interbase/interbase_result.php index 37f0a108c..9093029dd 100644 --- a/system/database/drivers/interbase/interbase_result.php +++ b/system/database/drivers/interbase/interbase_result.php @@ -52,7 +52,10 @@ class CI_DB_interbase_result extends CI_DB_result { return $this->num_rows; } - return 0; + //Get the results so that you can get an accurate rowcount + $this->result_array(); + + return $this->num_rows; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b