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