Code Duplication    Length = 22-22 lines in 2 locations

Sources/Subs-Db-mysql.php 1 location

@@ 460-481 (lines=22) @@
457
	}
458
459
	// Debugging.
460
	if (isset($db_show_debug) && $db_show_debug === true)
461
	{
462
		// Get the file and line number this function was called.
463
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
464
465
		// Initialize $db_cache if not already initialized.
466
		if (!isset($db_cache))
467
			$db_cache = array();
468
469
		if (!empty($_SESSION['debug_redirect']))
470
		{
471
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
472
			$db_count = count($db_cache) + 1;
473
			$_SESSION['debug_redirect'] = array();
474
		}
475
476
		// Don't overload it.
477
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
478
		$db_cache[$db_count]['f'] = $file;
479
		$db_cache[$db_count]['l'] = $line;
480
		$db_cache[$db_count]['s'] = ($st = microtime(true)) - $time_start;
481
	}
482
483
	if (empty($db_unbuffered))
484
		$ret = @mysqli_query($connection, $db_string);

Sources/Subs-Db-postgresql.php 1 location

@@ 468-489 (lines=22) @@
465
	}
466
467
	// Debugging.
468
	if (isset($db_show_debug) && $db_show_debug === true)
469
	{
470
		// Get the file and line number this function was called.
471
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
472
473
		// Initialize $db_cache if not already initialized.
474
		if (!isset($db_cache))
475
			$db_cache = array();
476
477
		if (!empty($_SESSION['debug_redirect']))
478
		{
479
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
480
			$db_count = count($db_cache) + 1;
481
			$_SESSION['debug_redirect'] = array();
482
		}
483
484
		// Don't overload it.
485
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
486
		$db_cache[$db_count]['f'] = $file;
487
		$db_cache[$db_count]['l'] = $line;
488
		$db_cache[$db_count]['s'] = ($st = microtime(true)) - $time_start;
489
	}
490
491
	$db_last_result = @pg_query($connection, $db_string);
492