private function _dbgQuery($query, $link, $result, $time)
{
$dbgInfo = array();
$error_message = $this->getError($link);
if ($result == false && is_string($error_message)) {
$dbgInfo['error'] = '<span style="color:red">' . htmlspecialchars($error_message) . '</span>';
}
$dbgInfo['query'] = htmlspecialchars($query);
$dbgInfo['time'] = $time;
// Get and slightly format backtrace, this is used
// in the javascript console.
// Strip call to _dbgQuery
$dbgInfo['trace'] = Error::processBacktrace(array_slice(debug_backtrace(), 1));
$dbgInfo['hash'] = md5($query);
$_SESSION['debug']['queries'][] = $dbgInfo;
}