Take an optional debug param in dbQuery
This commit is contained in:
parent
ae7a706526
commit
baeb1dbd5b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue