From 9827a86a2069f44d50a39c42dc4f5c06310b55c3 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Wed, 22 Feb 2012 11:38:09 -0500 Subject: [PATCH] Misc. Firebird class fixes --- src/databases/firebird.php | 23 ++++++++--------------- src/databases/firebird_manip.php | 1 - 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/databases/firebird.php b/src/databases/firebird.php index beb2125..adba703 100644 --- a/src/databases/firebird.php +++ b/src/databases/firebird.php @@ -20,7 +20,6 @@ class firebird extends DB_PDO { protected $conn, $statement, $trans, $count, $result; - private $esc_char = "''"; /** * Open the link to the database @@ -195,21 +194,15 @@ SQL; public function num_rows() { // @todo: Redo this similar to the codeigniter driver - $count = 0; - - if(isset($this->statement)) + if(isset($this->result)) { - while($row = $this->fetch()) - { - $count++; - } - } - else - { - return FALSE; + return count($this->result); } - return $count; + //Fetch all the rows for the result + $this->result = $this->fetchAll(); + + return count($this->result); } /** @@ -256,7 +249,7 @@ SQL; public function execute($args) { // Is there a better way to do this? - return eval("ibase_execute({$this->statement},".explode(',', $args).")"); - } + return eval('ibase_execute('.$this->statement.','.explode(',', $args).")"); + } } // End of firebird.php \ No newline at end of file diff --git a/src/databases/firebird_manip.php b/src/databases/firebird_manip.php index 430ab50..e5a844f 100644 --- a/src/databases/firebird_manip.php +++ b/src/databases/firebird_manip.php @@ -87,6 +87,5 @@ class firebird_manip extends db_manip { { return 'DROP TABLE "'.$name.'"'; } - } //End of firebird_manip.php \ No newline at end of file