本文整理汇总了PHP中FDB::error方法的典型用法代码示例。如果您正苦于以下问题:PHP FDB::error方法的具体用法?PHP FDB::error怎么用?PHP FDB::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FDB
的用法示例。
在下文中一共展示了FDB::error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showError
/**
* 显示错误
* @param string $type 错误类型
* @param string $error_msg 错误提示
* @param string $show_trace
* @return void
*/
function showError($type, $error_msg, $show_trace = '')
{
global $_FANWE;
ob_end_clean();
$gzip = $_FANWE['gzip_compress'];
ob_start($gzip ? 'ob_gzhandler' : NULL);
$host = $_SERVER['HTTP_HOST'];
$show_trace = trim($show_trace);
$title = $type == 'db' ? 'Database' : 'System';
echo <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
\t<title>{$host} - {$title} Error</title>
\t<meta http-equiv="Content-Type" content="text/html; charset={$_FANWE['config']['output']['charset']}" />
\t<meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
\t<style type="text/css">
\t<!--
\tbody { background-color: white; color: black; }
\t#container { width: 650px; }
\t#message { width: 650px; color: black; background-color: #FFFFCC; }
\t#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
\t.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
\t.help { font: 12px verdana, arial, sans-serif; color: red;}
\t.red {color: red;}
\ta:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
\ta:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
\t-->
\t</style>
</head>
<body>
<table cellpadding="1" cellspacing="5" id="container">
<tr>
\t<td id="bodytitle" width="100%">FANWE {$title} Error </td>
</tr>
EOT;
if ($type == 'db') {
$help_link = "http://help.fanwe.com/?type=mysql&db_errno=" . rawurlencode(FDB::errno()) . "&db_error=" . rawurlencode(FDB::error());
echo <<<EOT
<tr>
\t<td class="bodytext">The database has encountered a problem. </td>
</tr>
EOT;
} else {
echo <<<EOT
<tr>
\t<td class="bodytext">Your request has encountered a problem. </td>
</tr>
EOT;
}
echo <<<EOT
<tr><td><hr size="1"/></td></tr>
<tr><td class="bodytext">Error messages: </td></tr>
<tr>
\t<td class="bodytext" id="message">
\t\t<br/>
\t\t<ul> {$error_msg}</ul>
\t</td>
</tr>
EOT;
if (!empty($show_trace)) {
echo <<<EOT
<tr><td class="bodytext"> </td></tr>
<tr><td class="bodytext">Program messages: </td></tr>
<tr>
\t<td class="bodytext">
\t\t<ul> {$show_trace} </ul>
\t</td>
</tr>
EOT;
}
//$end_msg = lang('error', 'error_end_message', array('host'=>$host));
echo <<<EOT
<tr>
\t<td class="help"><br><br>{$end_msg}</td>
</tr>
</table>
</body>
</html>
EOT;
$exit && exit;
}