From 7695b94f766c7eb9722ddb59501b689b4492f449 Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 19 Apr 2006 05:20:18 +0000 Subject: [PATCH] Firebird changes - fixed sql_nextid() - sql_affectedrows fixed for PHP 5+ - sql_affectedrows modified so that it works for PHP 4 ( don't expect a valid numeric answer! ) git-svn-id: file:///svn/phpbb/trunk@5805 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 67c906c087..c94fd00882 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -165,11 +165,11 @@ class dbal_firebird extends dbal // PHP 5+ function if (function_exists('ibase_affected_rows')) { - return ($this->query_result) ? @ibase_affected_rows($this->query_result) : false; + return ($this->db_connect_id) ? @ibase_affected_rows($this->db_connect_id) : false; } else { - return false; //($this->query_result) ? true : false; + return ($this->query_result) ? true : false; } } @@ -275,7 +275,7 @@ class dbal_firebird extends dbal { if ($this->query_result && preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename)) { - $query = "SELECT GEN_ID('" . $tablename[1] . "_gen', 0) AS new_id + $query = "SELECT GEN_ID(" . $tablename[1] . "_gen, 0) AS new_id FROM RDB\$DATABASE"; if (!($temp_q_id = @ibase_query($this->db_connect_id, $query))) { @@ -285,7 +285,7 @@ class dbal_firebird extends dbal $temp_result = @ibase_fetch_object($temp_q_id); @ibase_free_result($temp_q_id); - return ($temp_result) ? $temp_result->last_value : false; + return ($temp_result) ? $temp_result->NEW_ID : false; } }