diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 589e68007e..6346567076 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -191,7 +191,10 @@ class sql_db
$this->sql_report .= "
\n";
}
- $this->open_queries[] = $this->query_result;
+ if (preg_match('/^SELECT/', $query))
+ {
+ $this->open_queries[] = $this->query_result;
+ }
}
if (!empty($cache_result))
diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php
index 399c8aed96..6eb0a2c811 100644
--- a/phpBB/includes/db/mysql4.php
+++ b/phpBB/includes/db/mysql4.php
@@ -187,7 +187,10 @@ class sql_db
$this->sql_report .= "
\n";
}
- $this->open_queries[] = $this->query_result;
+ if (preg_match('/^SELECT/', $query))
+ {
+ $this->open_queries[] = $this->query_result;
+ }
}
if (!empty($cache_result))