diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index cbeb3dca24..1fee674f80 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -452,7 +452,7 @@ class dbal
if (!$this->return_on_error)
{
- $message = 'SQL ERROR [ ' . $db->sql_layer . ' ]
' . $error['message'] . ' [' . $error['code'] . ']';
+ $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]
' . $error['message'] . ' [' . $error['code'] . ']';
// Show complete SQL error and path to administrators only
// Additionally show complete error on installation or if extended debug mode is enabled
@@ -551,7 +551,7 @@ class dbal
Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries['normal']} queries" . (($this->num_queries['cached']) ? " + {$this->num_queries['cached']} " . (($this->num_queries['cached'] == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '
-Time spent on ' . $db->sql_layer . ' queries: ' . round($this->sql_time, 5) . 's | Time spent on PHP: ' . round($totaltime - $this->sql_time, 5) . 's
+Time spent on ' . $this->sql_layer . ' queries: ' . round($this->sql_time, 5) . 's | Time spent on PHP: ' . round($totaltime - $this->sql_time, 5) . 's