Skip to content
Permalink
Browse files

* Just a quick debug option in MySQL processing to view complex queri…

…es instead of executing them. (Class-DB.php)

@ I'm back! Well, I was never gone... Just didn't bother backporting all of my changes.
  • Loading branch information...
Nao committed May 23, 2018
1 parent 5713082 commit 1ecc2093c8fb5bb3f90221622926b6696494fdaa
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/app/Class-DB.php
@@ -107,7 +107,7 @@ public static function quote($query, $db_values, $connection = null)
return $query;
}
public static function query($query, $db_values = array(), $connection = null)
public static function query($query, $db_values = array(), $connection = null, $testing = false)
{
global $db_cache, $db_count, $db_show_debug, $time_start;
global $db_unbuffered, $db_callback, $settings;
@@ -234,7 +234,10 @@ public static function query($query, $db_values = array(), $connection = null)
self::error_backtrace('Hacking attempt...', 'Hacking attempt...' . "\n" . $query, E_USER_ERROR);
}
$ret = @mysqli_query($connection, $query, empty($db_unbuffered) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
if ($testing)
exit(print_r($query, true));
else
$ret = @mysqli_query($connection, $query, empty($db_unbuffered) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
if ($ret === false && empty($db_values['db_error_skip']))
$ret = self::serious_error($query, $connection);

0 comments on commit 1ecc209

Please sign in to comment.
You can’t perform that action at this time.