From baeb1dbd5b65cc2e5378554ba9239ba4a904d0e5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 1 Dec 2020 14:07:23 -0500 Subject: [PATCH] Take an optional debug param in dbQuery --- web/includes/database.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/includes/database.php b/web/includes/database.php index 2fb2db108..637b20fa0 100644 --- a/web/includes/database.php +++ b/web/includes/database.php @@ -125,7 +125,7 @@ function dbEscape( $string ) { return $dbConn->quote($string); } -function dbQuery($sql, $params=NULL) { +function dbQuery($sql, $params=NULL, $debug = false) { global $dbConn; if ( dbLog($sql, true) ) return; @@ -142,7 +142,7 @@ function dbQuery($sql, $params=NULL) { return NULL; } } else { - if ( defined('ZM_DB_DEBUG') ) { + if ( defined('ZM_DB_DEBUG') or $debug ) { ZM\Logger::Debug("SQL: $sql values:" . ($params?implode(',',$params):'')); } $result = $dbConn->query($sql); @@ -151,7 +151,7 @@ function dbQuery($sql, $params=NULL) { return NULL; } } - if ( defined('ZM_DB_DEBUG') ) { + if ( defined('ZM_DB_DEBUG') or $debug ) { if ( $params ) ZM\Logger::Debug("SQL: $sql " . implode(',',$params) . ' rows: '.$result->rowCount()); else