aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mysql.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2005-04-20 20:47:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2005-04-20 20:47:03 +0000
commit7b16107513051ff2d75c21620beb7d49386325c2 (patch)
tree12ec45c5b08b437dcb7b5811428cb0e9eb8f8bf3 /phpBB/includes/db/mysql.php
parent3dd6b0ddc3eae81ba39366c3b5f0d07edcdd487f (diff)
downloadforums-7b16107513051ff2d75c21620beb7d49386325c2.tar
forums-7b16107513051ff2d75c21620beb7d49386325c2.tar.gz
forums-7b16107513051ff2d75c21620beb7d49386325c2.tar.bz2
forums-7b16107513051ff2d75c21620beb7d49386325c2.tar.xz
forums-7b16107513051ff2d75c21620beb7d49386325c2.zip
tiny fixes
git-svn-id: file:///svn/phpbb/trunk@5128 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/mysql.php')
-rw-r--r--phpBB/includes/db/mysql.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index b1aefc66ca..bbc4b5d289 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -87,18 +87,23 @@ class sql_db
switch ($status)
{
case 'begin':
- $this->transaction = true;
$result = @mysql_query('BEGIN', $this->db_connect_id);
+ $this->transaction = true;
break;
case 'commit':
- $this->transaction = false;
$result = @mysql_query('COMMIT', $this->db_connect_id);
+ $this->transaction = false;
+
+ if (!$result)
+ {
+ @mysql_query('ROLLBACK', $this->db_connect_id);
+ }
break;
case 'rollback':
- $this->transaction = false;
$result = @mysql_query('ROLLBACK', $this->db_connect_id);
+ $this->transaction = false;
break;
default:
@@ -281,16 +286,20 @@ class sql_db
{
$query_id = $this->query_result;
}
+
if ($query_id)
{
unset($this->rowset[$query_id]);
unset($this->row[$query_id]);
+
+ $result = array();
while ($this->rowset[$query_id] = $this->sql_fetchrow($query_id))
{
$result[] = $this->rowset[$query_id];
}
return $result;
}
+
return false;
}
@@ -300,6 +309,7 @@ class sql_db
{
$query_id = $this->query_result;
}
+
if ($query_id)
{
if ($rownum > -1)
@@ -310,7 +320,7 @@ class sql_db
{
if (empty($this->row[$query_id]) && empty($this->rowset[$query_id]))
{
- if ($this->sql_fetchrow())
+ if ($this->sql_fetchrow($query_id))
{
$result = $this->row[$query_id][$field];
}